Ë
    ›2ÚiB'  ã                  óD  — d dl mZ d dlmZmZmZmZmZ erddlm	Z	m
Z
mZmZmZ d dlmZ ddlmZ d dlZd„ Zdddd	œ	 	 	 	 	 	 	 	 	 d!d
„Z	 	 d"dddœ	 	 	 	 	 	 	 	 	 	 	 d#d„Zdddœ	 	 	 	 	 	 	 d$d„Zdddœ	 	 	 	 	 	 	 d%d„Z	 d&d dddœ	 	 	 	 	 	 	 	 	 	 	 d'd„Zd(d„Zdddœ	 	 	 	 	 	 	 	 	 d)d„Zdddœ	 	 	 	 	 	 	 	 	 d*d„Zddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 d+d„Zddœd,d„Zdddœ	 	 	 	 	 	 	 d$d„Zdddœ	 	 	 	 	 	 	 d%d„Z d dœd-d„Z!d dœd-d„Z"dddœ	 	 	 	 	 	 	 d$d„Z#dddœ	 	 	 	 	 	 	 d%d „Z$y).é    )Úannotations)ÚTYPE_CHECKINGÚListÚOptionalÚTupleÚUnioné   )ÚArrayÚDeviceÚDtypeÚNestedSequenceÚSupportsBufferProtocol)ÚSequence)Ú_all_dtypesNc                ó@   — dt         z   D ]  }| |u sŒ y  t        d«      ‚)N©Nz)dtype must be one of the supported dtypes)r   Ú
ValueError)ÚdtypeÚds     úZ/var/www/html/acx/venv/lib/python3.12/site-packages/numpy/array_api/_creation_functions.pyÚ_check_valid_dtyper      s0   € ð
 ”{Ñ"ò ˆØ�AŠ:Ùðô Ð@Ó
AÐAó    )r   ÚdeviceÚcopyc              ó  — ddl m} t        |«       |dvrt        d|›�«      ‚|dt        j
                  j                  fv rt        d«      ‚t        | |«      re|�| j                  |k7  rd}|dt        j
                  j                  fv r2 |j                  t	        j                  | j                  d|¬«      «      S | S |€%t        | t        «      r| d	kD  s| d
k  rt        d«      ‚t	        j                   | |¬«      } |j                  |«      S )z~
    Array API compatible wrapper for :py:func:`np.asarray <numpy.asarray>`.

    See its docstring for more information.
    r	   ©r
   ©ÚcpuNúUnsupported device Fz!copy=False is not yet implementedT)r   r   l            lûÿÿÿ         z&Integer out of bounds for array dtypes©r   )Ú_array_objectr
   r   r   ÚnpÚ	_CopyModeÚ	IF_NEEDEDÚNotImplementedErrorÚ
isinstancer   ÚALWAYSÚ_newÚarrayÚ_arrayÚintÚOverflowErrorÚasarray)Úobjr   r   r   r
   Úress         r   r-   r-      sô   € õ, %ä�uÔØ�]Ñ"ÜÐ.¨v¨jÐ9Ó:Ð:Ø�”r—|‘|×-Ñ-Ð.Ñ.ä!Ð"EÓFÐFÜ�#�uÔØÐ §¡¨eÒ!3ØˆDØ�Dœ"Ÿ,™,×-Ñ-Ð.Ñ.Ø�5—:‘:œbŸh™h s§z¡z¸ÀEÔJÓKÐKØˆ
Ø€}œ C¬Ô-°3¸²=ÀCÈ*ÒDTô ÐDÓEÐEÜ
�*‰*�S Ô
&€CØˆ5�:‰:�c‹?Ðr   )r   r   c              óš   — ddl m} t        |«       |dvrt        d|›�«      ‚ |j                  t        j                  | |||¬«      «      S )z|
    Array API compatible wrapper for :py:func:`np.arange <numpy.arange>`.

    See its docstring for more information.
    r	   r   r   r   )ÚstopÚstepr   )r!   r
   r   r   r(   r"   Úarange)Ústartr1   r2   r   r   r
   s         r   r3   r3   K   sJ   € õ %ä�uÔØ�]Ñ"ÜÐ.¨v¨jÐ9Ó:Ð:Øˆ5�:‰:”b—i‘i ¨D°tÀ5ÔIÓJÐJr   c               ó–   — ddl m} t        |«       |dvrt        d|›�«      ‚ |j                  t        j                  | |¬«      «      S )zz
    Array API compatible wrapper for :py:func:`np.empty <numpy.empty>`.

    See its docstring for more information.
    r	   r   r   r   r    )r!   r
   r   r   r(   r"   Úempty©Úshaper   r   r
   s       r   r6   r6   a   óF   € õ %ä�uÔØ�]Ñ"ÜÐ.¨v¨jÐ9Ó:Ð:Øˆ5�:‰:”b—h‘h˜u¨EÔ2Ó3Ð3r   c              óª   — ddl m} t        |«       |dvrt        d|›�«      ‚ |j                  t        j                  | j                  |¬«      «      S )z„
    Array API compatible wrapper for :py:func:`np.empty_like <numpy.empty_like>`.

    See its docstring for more information.
    r	   r   r   r   r    )r!   r
   r   r   r(   r"   Ú
empty_liker*   ©Úxr   r   r
   s       r   r;   r;   t   óJ   € õ %ä�uÔØ�]Ñ"ÜÐ.¨v¨jÐ9Ó:Ð:Øˆ5�:‰:”b—m‘m A§H¡H°EÔ:Ó;Ð;r   )Úkr   r   c              óš   — ddl m} t        |«       |dvrt        d|›�«      ‚ |j                  t        j                  | |||¬«      «      S )zv
    Array API compatible wrapper for :py:func:`np.eye <numpy.eye>`.

    See its docstring for more information.
    r	   r   r   r   )ÚMr?   r   )r!   r
   r   r   r(   r"   Úeye)Ún_rowsÚn_colsr?   r   r   r
   s         r   rB   rB   „   sJ   € õ %ä�uÔØ�]Ñ"ÜÐ.¨v¨jÐ9Ó:Ð:Øˆ5�:‰:”b—f‘f˜V v°¸%Ô@ÓAÐAr   c               óX   — ddl m}  |j                  t        j                  | «      «      S )Nr	   r   )r!   r
   r(   r"   Úfrom_dlpack)r=   r
   s     r   rF   rF   š   s   € Ý$àˆ5�:‰:”b—n‘n QÓ'Ó(Ð(r   c               ó$  — ddl m} t        |«       |dvrt        d|›�«      ‚t	        ||«      r|j
                  dk(  r|j                  }t        j                  | ||¬«      }|j                  t        vrt        d«      ‚ |j                  |«      S )zx
    Array API compatible wrapper for :py:func:`np.full <numpy.full>`.

    See its docstring for more information.
    r	   r   r   r   r   r    zInvalid input to full)r!   r
   r   r   r&   Úndimr*   r"   Úfullr   r   Ú	TypeErrorr(   )r8   Ú
fill_valuer   r   r
   r/   s         r   rI   rI       s†   € õ %ä�uÔØ�]Ñ"ÜÐ.¨v¨jÐ9Ó:Ð:Ü�*˜eÔ$¨¯©¸AÒ)=Ø×&Ñ&ˆ
Ü
�'‰'�%˜¨5Ô
1€CØ
‡y�yœÑ#ô Ð/Ó0Ð0Øˆ5�:‰:�c‹?Ðr   c              óê   — ddl m} t        |«       |dvrt        d|›�«      ‚t	        j
                  | j                  ||¬«      }|j                  t        vrt        d«      ‚ |j                  |«      S )z‚
    Array API compatible wrapper for :py:func:`np.full_like <numpy.full_like>`.

    See its docstring for more information.
    r	   r   r   r   r    zInvalid input to full_like)r!   r
   r   r   r"   Ú	full_liker*   r   r   rJ   r(   )r=   rK   r   r   r
   r/   s         r   rM   rM   »   sj   € õ %ä�uÔØ�]Ñ"ÜÐ.¨v¨jÐ9Ó:Ð:Ü
�,‰,�q—x‘x °5Ô
9€CØ
‡y�yœÑ#ô Ð4Ó5Ð5Øˆ5�:‰:�c‹?Ðr   T)r   r   Úendpointc         	     óœ   — ddl m} t        |«       |dvrt        d|›�«      ‚ |j                  t        j                  | ||||¬«      «      S )z€
    Array API compatible wrapper for :py:func:`np.linspace <numpy.linspace>`.

    See its docstring for more information.
    r	   r   r   r   )r   rN   )r!   r
   r   r   r(   r"   Úlinspace)r4   r1   Únumr   r   rN   r
   s          r   rP   rP   Õ   sL   € õ %ä�uÔØ�]Ñ"ÜÐ.¨v¨jÐ9Ó:Ð:Øˆ5�:‰:”b—k‘k %¨¨s¸%È(ÔSÓTÐTr   Úxy)Úindexingc                ó$  — ddl m} t        |D �ch c]  }|j                  ’Œ c}«      dkD  rt	        d«      ‚t        j                  |D �cg c]  }|j                  ‘Œ c}d| iŽD �cg c]  } |j                  |«      ‘Œ c}S c c}w c c}w c c}w )z€
    Array API compatible wrapper for :py:func:`np.meshgrid <numpy.meshgrid>`.

    See its docstring for more information.
    r	   r   z,meshgrid inputs must all have the same dtyperS   )	r!   r
   Úlenr   r   r"   Úmeshgridr*   r(   )rS   Úarraysr
   Úar)   s        r   rV   rV   ì   s…   € õ %ô
 ˜VÖ$˜ˆA�G‹GÒ$Ó%¨Ò)ÜÐGÓHÐHô —[‘[°VÖ"<° 1§8£8Ò"<ÐPÀxÑPöàð 	ˆ�
‰
�5Õòð ùò %ùò
 #=ùòs   �BÁBÁ'Bc               ó–   — ddl m} t        |«       |dvrt        d|›�«      ‚ |j                  t        j                  | |¬«      «      S )zx
    Array API compatible wrapper for :py:func:`np.ones <numpy.ones>`.

    See its docstring for more information.
    r	   r   r   r   r    )r!   r
   r   r   r(   r"   Úonesr7   s       r   rZ   rZ      sF   € õ %ä�uÔØ�]Ñ"ÜÐ.¨v¨jÐ9Ó:Ð:Øˆ5�:‰:”b—g‘g˜e¨5Ô1Ó2Ð2r   c              óª   — ddl m} t        |«       |dvrt        d|›�«      ‚ |j                  t        j                  | j                  |¬«      «      S )z‚
    Array API compatible wrapper for :py:func:`np.ones_like <numpy.ones_like>`.

    See its docstring for more information.
    r	   r   r   r   r    )r!   r
   r   r   r(   r"   Ú	ones_liker*   r<   s       r   r\   r\     sJ   € õ %ä�uÔØ�]Ñ"ÜÐ.¨v¨jÐ9Ó:Ð:Øˆ5�:‰:”b—l‘l 1§8¡8°5Ô9Ó:Ð:r   ©r?   c              ó¤   — ddl m} | j                  dk  rt        d«      ‚ |j                  t        j                  | j                  |¬«      «      S )zx
    Array API compatible wrapper for :py:func:`np.tril <numpy.tril>`.

    See its docstring for more information.
    r	   r   é   z)x must be at least 2-dimensional for trilr]   )r!   r
   rH   r   r(   r"   Útrilr*   ©r=   r?   r
   s      r   r`   r`   #  ó>   € õ %à‡v�v�‚zäÐDÓEÐEØˆ5�:‰:”b—g‘g˜aŸh™h¨!Ô,Ó-Ð-r   c              ó¤   — ddl m} | j                  dk  rt        d«      ‚ |j                  t        j                  | j                  |¬«      «      S )zx
    Array API compatible wrapper for :py:func:`np.triu <numpy.triu>`.

    See its docstring for more information.
    r	   r   r_   z)x must be at least 2-dimensional for triur]   )r!   r
   rH   r   r(   r"   Útriur*   ra   s      r   rd   rd   1  rb   r   c               ó–   — ddl m} t        |«       |dvrt        d|›�«      ‚ |j                  t        j                  | |¬«      «      S )zz
    Array API compatible wrapper for :py:func:`np.zeros <numpy.zeros>`.

    See its docstring for more information.
    r	   r   r   r   r    )r!   r
   r   r   r(   r"   Úzerosr7   s       r   rf   rf   ?  r9   r   c              óª   — ddl m} t        |«       |dvrt        d|›�«      ‚ |j                  t        j                  | j                  |¬«      «      S )z„
    Array API compatible wrapper for :py:func:`np.zeros_like <numpy.zeros_like>`.

    See its docstring for more information.
    r	   r   r   r   r    )r!   r
   r   r   r(   r"   Ú
zeros_liker*   r<   s       r   rh   rh   R  r>   r   )
r.   zZUnion[Array, bool, int, float, NestedSequence[bool | int | float], SupportsBufferProtocol]r   úOptional[Dtype]r   úOptional[Device]r   z#Optional[Union[bool, np._CopyMode]]Úreturnr
   )Nr	   )r1   zOptional[Union[int, float]]r2   úUnion[int, float]r4   rl   r   ri   r   rj   rk   r
   )r8   úUnion[int, Tuple[int, ...]]r   ri   r   rj   rk   r
   )r=   r
   r   ri   r   rj   rk   r
   r   )rC   r+   rD   zOptional[int]r?   r+   r   ri   r   rj   rk   r
   )r=   Úobjectrk   r
   )
r8   rm   rK   rl   r   ri   r   rj   rk   r
   )
rK   rl   r=   r
   r   ri   r   rj   rk   r
   )rQ   r+   r4   rl   r1   rl   r   ri   r   rj   rN   Úboolrk   r
   )rW   r
   rS   Ústrrk   zList[Array])r=   r
   r?   r+   rk   r
   )%Ú
__future__r   Útypingr   r   r   r   r   Ú_typingr
   r   r   r   r   Úcollections.abcr   Ú_dtypesr   Únumpyr"   r   r-   r3   r6   r;   rB   rF   rI   rM   rP   rV   rZ   r\   r`   rd   rf   rh   © r   r   ú<module>rx      s;  ðÝ "÷ ?Õ >á÷õ õ )Ý  ã òBð, "Ø#Ø04ñ)ð
ð)ð ð)ð ð)ð .ð)ð ó)ð^ )-Øð	Kð "Ø#ñKð &ðKð ð	KØðKð ðKð ðKð óKð2 "Ø#ñ	4Ø&ð4ð ð4ð ð	4ð
 ó4ð( .2Èdñ<Øð<Ø*ð<Ø;Kð<à
ó<ð$ !ðBð
 Ø!Ø#ñBØðBàðBð
 ðBð ðBð ðBð óBó,)ð "Ø#ñØ&ðà!ðð ð	ð
 ðð óð@ "Ø#ñð "ðØðð
 ðð ðð óð@ "Ø#ØñUð 
ð	UØðUà
ðUð ðUð ðUð ðUð óUð. .2õ ð. "Ø#ñ	3Ø&ð3ð ð3ð ð	3ð
 ó3ð( .2Èdñ;Øð;Ø*ð;Ø;Kð;à
ó;ð  #$õ .ð #$õ .ð" "Ø#ñ	4Ø&ð4ð ð4ð ð	4ð
 ó4ð( .2Èdñ<Øð<Ø*ð<Ø;Kð<à
ô<r   