Ë
    °Ó^jk  ã                   óÎ   — U d Z ddlmZmZmZmZ ddlZddlm	Z	m
Z
 ddlmZ ed   Zeed<   d	dd
œdedededededdfd„Zdededefd„Zddee   dedefd„Zddee   dedefd„Zy)zHelpers for test code.é    )ÚAnyÚLiteralÚSequenceÚ	TypeAliasNé   )Ú_is_cupy_alikeÚimport_cupy)ÚDMatrix)ÚcpuÚcudaÚDevicegH¯¼šò×z>)ÚrtolÚatolÚdeviceÚaÚbr   r   Úreturnc                óÔ   — | dk(  r:t        |«      s/t        |«      s$t        j                  j                  ||||¬«       yt	        «       }|j                  j                  ||||¬«       y)z)Dispatch the assert_allclose for devices.r   )r   r   N)r   ÚnpÚtestingÚassert_allcloser	   )r   r   r   r   r   Úcps         ú`/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/xgboost/testing/utils.pyr   r      sV   € ð �‚œ~¨aÔ0¼ÈÔ9JÜ
�
‰
×"Ñ" 1 a¨d¸Ð"Õ>ä‹]ˆØ
�
‰
×"Ñ" 1 a¨d¸Ð"Õ>ó    ÚlhsÚrhsc                 óN  — | j                  «       }|j                  «       }t        t        j                  |j                  |j                  «      t        j                  |j
                  |j
                  «      t        j                  |j                  |j                  «      f«      S )z9Assert whether two DMatrices contain the same predictors.)Úget_dataÚallr   Úarray_equalÚdataÚindicesÚindptr)r   r   ÚlcsrÚrcsrs       r   Úpredictor_equalr&      sl   € à�<‰<‹>€DØ�<‰<‹>€DÜä�N‰N˜4Ÿ9™9 d§i¡iÓ0Ü�N‰N˜4Ÿ<™<¨¯©Ó6Ü�N‰N˜4Ÿ;™;¨¯©Ó4ð	
óð r   ÚLÚ	tolerancec           	      óF   ‡— t        ˆfd„t        | | dd «      D «       «      S )z*Values in the sequence are not increasing.c              3   ó4   •K  — | ]  \  }}||z
  ‰k  –— Œ y ­w©N© ©Ú.0ÚxÚyr(   s      €r   ú	<genexpr>z!non_increasing.<locals>.<genexpr>'   s   øè ø€ Ò=¡t q¨!��A‘˜Õ"Ñ=ùs   ƒé   N©r   Úzip©r'   r(   s    `r   Únon_increasingr6   %   s    ø€ äÓ=¬s°1°a¸¸°e«}Ô=Ó=Ð=r   c           	      óF   ‡— t        ˆfd„t        | | dd «      D «       «      S )z*Values in the sequence are not decreasing.c              3   ó6   •K  — | ]  \  }}||z
  ‰ k\  –— Œ y ­wr+   r,   r-   s      €r   r1   z!non_decreasing.<locals>.<genexpr>,   s    øè ø€ Ò?©¨¨A��A‘˜9˜*Õ$Ñ?ùs   ƒr2   Nr3   r5   s    `r   Únon_decreasingr9   *   s    ø€ äÓ?´°Q¸¸!¸"¸³Ô?Ó?Ð?r   )g-Cëâ6?)Ú__doc__Útypingr   r   r   r   Únumpyr   Úcompatr   r	   Úcorer
   r   Ú__annotations__Úfloatr   Úboolr&   r6   r9   r,   r   r   ú<module>rB      s¼   ðÚ ç 4Ó 4ã ç 0Ý à˜MÑ*€ˆ	Ó *ð 6:Èò?Øð?Øð?Ø"ð?Ø-2ð?ØAFð?à	ó?ð
˜ð 
 wð 
°4ó 
ñ>�h˜u‘oð >°%ð >À4ó >ñ
@�h˜u‘oð @°%ð @À4ô @r   