bgB'vddlmZddlmZmZmZmZmZerddlm Z m Z m Z m Z m Z ddlmZddlmZddlZdZdddd dAdZ dBddddCdZddddDdZddddEd Z dFdddd!dGd'ZdHd)ZddddId+ZddddJd,Zddd-d.dKd2Zd3d4dLd9ZddddDd:ZddddEd;Z dd<dMd=Z!dd<dMd>Z"ddddDd?Z#ddddEd@Z$dS)N) annotations) TYPE_CHECKINGListOptionalTupleUnion)ArrayDeviceDtypeNestedSequenceSupportsBufferProtocol)Sequence) _all_dtypesNcHdtzD] }||urdS td)NNz)dtype must be one of the supported dtypes)r ValueError)dtypeds v/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib64/python3.11/site-packages/numpy/array_api/_creation_functions.py_check_valid_dtypers< { " A:: FF  @ A AA)rdevicecopyobjZUnion[Array, bool, int, float, NestedSequence[bool | int | float], SupportsBufferProtocol]rOptional[Dtype]rOptional[Device]r#Optional[Union[bool, np._CopyMode]]returnr cddlm}t||dvrtd||dtjjfvrtdt||rP| |j |krd}|dtjj fvr*|j t j |j d| S|S|0t|tr|d ks|d krtd t j|| }|j |S)z~ Array API compatible wrapper for :py:func:`np.asarray `. See its docstring for more information. r r cpuNUnsupported device Fz!copy=False is not yet implementedNT)rrllz&Integer out of bounds for array dtypesr) _array_objectr rrnp _CopyMode IF_NEEDEDNotImplementedError isinstancerALWAYS_newarray_arrayint OverflowErrorasarray)rrrrr ress rr3r3s,,%$$$$$u ]""9v99::: r|-...!"EFFF#u  e!3!3D D",-. . .5:bhszEJJJKK K  }C--}3==C*DTDTDEEE *S & & &C 5:c??r)rrstopOptional[Union[int, float]]stepUnion[int, float]startcddlm}t||dvrtd||jt j||||S)z| Array API compatible wrapper for :py:func:`np.arange `. See its docstring for more information. r r"r#r%)r5r7r)r'r rrr.r(arange)r9r5r7rrr s rr;r;Ksk%$$$$$u ]""9v99::: 5:biDt5III J JJrshapeUnion[int, Tuple[int, ...]]cddlm}t||dvrtd||jt j||S)zz Array API compatible wrapper for :py:func:`np.empty `. See its docstring for more information. r r"r#r%r&)r'r rrr.r(emptyr<rrr s rr?r?ag%$$$$$u ]""9v99::: 5:bhuE222 3 33rxcddlm}t||dvrtd||jt j|j|S)z Array API compatible wrapper for :py:func:`np.empty_like `. See its docstring for more information. r r"r#r%r&)r'r rrr.r( empty_liker0rBrrr s rrDrDti%$$$$$u ]""9v99::: 5:bmAHE::: ; ;;r)krrn_rowsr1n_cols Optional[int]rGcddlm}t||dvrtd||jt j||||S)zv Array API compatible wrapper for :py:func:`np.eye `. See its docstring for more information. r r"r#r%)MrGr)r'r rrr.r(eye)rHrIrGrrr s rrMrMsk%$$$$$u ]""9v99::: 5:bfVv%@@@ A AArobjectcRddlm}|jtj|S)Nr r")r'r r.r( from_dlpack)rBr s rrPrPs0$$$$$$ 5:bnQ'' ( ((r fill_valuec$ddlm}t||dvrtd|t ||r|jdkr|j}tj|||}|j tvrtd|j |S)zx Array API compatible wrapper for :py:func:`np.full `. See its docstring for more information. r r"r#r%rr&zInvalid input to full) r'r rrr,ndimr0r(fullrr TypeErrorr.)r<rQrrr r4s rrTrTs%$$$$$u ]""9v99:::*e$$'A)=)=& '%5 1 1 1C y ##/000 5:c??rcddlm}t||dvrtd|t j|j||}|jtvrtd|j |S)z Array API compatible wrapper for :py:func:`np.full_like `. See its docstring for more information. r r"r#r%r&zInvalid input to full_like) r'r rrr( full_liker0rrrUr.)rBrQrrr r4s rrWrWs%$$$$$u ]""9v99::: ,qx5 9 9 9C y ##4555 5:c??rT)rrendpointnumrXboolc ddlm}t||dvrtd||jt j|||||S)z Array API compatible wrapper for :py:func:`np.linspace `. See its docstring for more information. r r"r#r%)rrX)r'r rrr.r(linspace)r9r5rYrrrXr s rr\r\sm%$$$$$u ]""9v99::: 5:bk%s%(SSS T TTrxy)indexingarraysr^str List[Array]cddlmtd|Ddkrtdfdt jd|Dd|iDS)z Array API compatible wrapper for :py:func:`np.meshgrid `. See its docstring for more information. r r"ch|] }|j Sr&.0as r zmeshgrid..s $ $ $AG $ $ $rz,meshgrid inputs must all have the same dtypec0g|]}j|Srd)r.)rfr/r s r zmeshgrid..s5      5   rcg|] }|j Srd)r0res rrjzmeshgrid..s"<"<"<18"<"<"`. See its docstring for more information. r r"r#r%r&)r'r rrr.r(onesr@s rrorosg%$$$$$u ]""9v99::: 5:bge5111 2 22rcddlm}t||dvrtd||jt j|j|S)z Array API compatible wrapper for :py:func:`np.ones_like `. See its docstring for more information. r r"r#r%r&)r'r rrr.r( ones_liker0rEs rrqrqsi%$$$$$u ]""9v99::: 5:bl185999 : ::rrGcddlm}|jdkrtd|jt j|j|S)zx Array API compatible wrapper for :py:func:`np.tril `. See its docstring for more information. r r"z)x must be at least 2-dimensional for trilrr)r'r rSrr.r(trilr0rBrGr s rruru#S %$$$$$vzzDEEE 5:bgah!,,, - --rcddlm}|jdkrtd|jt j|j|S)zx Array API compatible wrapper for :py:func:`np.triu `. See its docstring for more information. r r"rtz)x must be at least 2-dimensional for triurr)r'r rSrr.r(triur0rvs rryry1rwrcddlm}t||dvrtd||jt j||S)zz Array API compatible wrapper for :py:func:`np.zeros `. See its docstring for more information. r r"r#r%r&)r'r rrr.r(zerosr@s rr{r{?rArcddlm}t||dvrtd||jt j|j|S)z Array API compatible wrapper for :py:func:`np.zeros_like `. See its docstring for more information. r r"r#r%r&)r'r rrr.r( zeros_liker0rEs rr}r}RrFr) rrrrrrrrr r )Nr ) r5r6r7r8r9r8rrrrr r )r<r=rrrrr r )rBr rrrrr r r) rHr1rIrJrGr1rrrrr r )rBrNr r ) r<r=rQr8rrrrr r ) rQr8rBr rrrrr r )rYr1r9r8r5r8rrrrrXrZr r )r_r r^r`r ra)rBr rGr1r r )% __future__rtypingrrrrr_typingr r r r rcollections.abcr_dtypesrnumpyr(rr3r;r?rDrMrPrTrWr\rmrorqruryr{r}rdrrrsX""""""?>>>>>>>>>>>>>))((((( BBB,"#04))))))^)- K "#KKKKKK2"# 444444(.2d < < < < < <$!B !#BBBBBB,))))"# @"# @"#UUUUUU..2."# 333333(.2d ; ; ; ; ; ; #$ . . . . . .#$ . . . . . .""# 444444(.2d < < < < < < <