ó —Àv]c'@`sSdZddlmZddlmZyddlmZWn!ek r]ddlmZnXddl m Z ddl Z ddl Z ddl Z ddlmZddlZdd lmZmZmZdd lmZmZmZmZmZdd lmZmZmZmZmZdd lm Z dd l!m"Z"m#Z#ddl$m%Z%ddl$m&Z&ddl%m'Z'ddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8g'Z(d9Z)dZ*dZ+dZ,id9e-6dej.6dej/6dej06d:ej16d;ej26d<ej36d=ej46Z5ie-d96ej.d6ej/d6ej0d6ej1d:6ej2d;6ej3d<6ej4d=6Z6ie)d>6e*d?6e+d@6e,dA6Z7id>e)6d?e*6d@e+6dAe,6Z8iddB6ddC6d:d6Z9d9Z:dZ;dZ<dD„Z=edE„Z>dF„Z?dG„Z@dH„ZAde'fdI„ƒYZBdJ„ZCddK„ZDdL„ZEdM„ZFdN„ZGdO„ZHe-e-dP„ZIe-ee-dQ„ZJe-e-dR„Z dS„ZKe-dTde-e-edU„ZLeMe-edV„ZNe-dW„ZOdX„ZPdY„ZQdZ„ZRd[„ZSd\„ZTd]„ZUd^„ZVd_„ZWd`„ZXda„ZYdb„ZZdc„Z[dd„Z\de„Z]df„Z^dg„Z_dh„Z`di„ZadeMdj„Zbddddfe-dd:e-dk„Zce-e-dl„Zddde-e-dm„Zee-e-dn„Zfdoe-dp„Zgdehdq„Zie jje-e jkƒZledrƒZmedsƒZndt„ZoeleoƒZpdu„Zqdv„Zrdw„Zsdxe jtfdy„ƒYZudze jtfd{„ƒYZvd|e jtfd}„ƒYZwd~e jtfd„ƒYZxe jje-e jyexƒƒZzd€ewfde jkfd‚ezfgex_{ezdƒ„ƒZ|eMd„„Z}dS(…sNDArray API of MXNet.i(tabsolute_import(tdivision(tslice(tarrayN(treducei(t_LIBt numeric_typest integer_types(tc_strtc_arrayt c_array_buftc_handle_arrayt mx_real_t(tmx_uintt NDArrayHandlet check_callt DLPackHandletmx_int(t ctypes2buffer(tContexttcurrent_contexti(t _internal(top(t NDArrayBasetNDArrayt concatenatet_DTYPE_NP_TO_MXt_DTYPE_MX_TO_NPt _GRAD_REQ_MAPtonestaddtarangetlinspaceteyetdividetequaltfulltgreatert greater_equaltimdecodetlessert lesser_equalt logical_andt logical_ort logical_xortmaximumtminimumtmoveaxistmodulotmultiplyt not_equalt onehot_encodetpowertsubtractt true_dividetwaitallt_new_empty_handlet histogramtsplit_v2tto_dlpack_for_readtto_dlpack_for_writet from_dlpackt from_numpyiÿÿÿÿiiiit undefinedtdefaultt row_sparsetcsrtnulltwritecC`s)tƒ}ttjtj|ƒƒƒ|S(sšReturns a new empty handle. Empty handle can be used to hold a result. Returns ------- handle A new empty `NDArray` handle. (RRRtMXNDArrayCreateNonetctypestbyref(thdl((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR8ls c C`sŸtƒ}ttjtttd|ƒƒtt|ƒƒtj |j ƒtj |j ƒtj t |ƒƒtj t t tj|ƒjƒƒtj|ƒƒƒ|S(s´Return a new handle with specified shape and context. Empty handle is only used to hold results. Returns ------- handle A new empty `NDArray` handle. tI(RRRtMXNDArrayCreateExR R t native_arraytlenRFtc_intt device_typeidt device_idtintRtnptdtypettypeRG(tshapetctxt delay_allocRRRH((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt_new_alloc_handle{s  "c C`s~tƒ}ttjtj|ƒtj|ƒtt|ƒtt|ƒƒtjt t t j |ƒj ƒƒtj|ƒƒƒ|S(N(RRRtMXNDArrayCreateFromSharedMemExRFRMR RRLRPRRQRRRSRG(t shared_pidt shared_idRTRRRH((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt_new_from_shared_mem‘s     "cC`sttjƒƒdS(sÒWait for all async operations to finish in MXNet. This function is used for benchmarking only. .. note:: If your mxnet code throws an exception, then waitall can cause performance impact. N(RRtMXNDArrayWaitAll(((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR7s cC`s5tjdƒ}ttj|tj|ƒƒƒ|jS(Ni(RFRMRRtMXNDArrayGetStorageTypeRGtvalue(thandlet storage_type((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt _storage_type©scB`sáeZdZgZdZdZed„ƒZd„Zd„Z d„Z d„Z d„Z d „Z d „Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!d„Z"d„Z#d „Z$d!„Z%d"„Z&d#„Z'e'Z(d$„Z)d%„Z*d&„Z+d'„Z,d(„Z-d)„Z.d*„Z/d+„Z0d,„Z1d-„Z2d.„Z3d/„Z4d0„Z5d1„Z6d2„Z7d3„Z8d4„Z9d5„Z:d6„Z;d7„Z<d8„Z=d9„Z>d:„Z?d;„Z@d<„ZAd=„ZBd>„ZCd?„ZDd@„ZEdA„ZFdB„ZGdC„ZHdD„ZIdE„ZJdF„ZKdG„ZLdH„ZMdI„ZNdJ„ZOdK„ZPdL„ZQdM„ZRdN„ZSdO„ZTdP„ZUdQ„ZVdR„ZWdS„ZXdTdU„ZYdV„ZZdW„Z[dX„Z\dY„Z]dZ„Z^d[„Z_d\„Z`d]„Zad^„Zbd_„Zcd`„Zdda„Zedb„Zfdc„Zgdd„Zhde„Zidf„Zjdg„Zkdh„Zldi„Zmdj„Zndk„Zodl„Zpdm„Zqdn„Zrdo„Zsdp„Ztdq„Zudr„Zvds„Zwdt„Zxdu„Zydv„Zzdw„Z{dx„Z|dy„Z}dz„Z~d{„Zd|„Z€d}„Zd~„Z‚d„Zƒd€„Z„d„Z…d‚„Z†dƒ„Z‡d„„Zˆd…„Z‰d†„ZŠed‡„ƒZ‹edˆ„ƒZŒed‰„ƒZedŠ„ƒZŽed‹„ƒZedŒ„ƒZed„ƒZ‘edŽ„ƒZ’e’j“d„ƒZ’d„Z”d‘„Z•e–d’„Z—d“„Z˜d”„Z™d•„Zšd–džd—„Zœed˜„ƒZd™„ZždžeŸe–dš„Z d›„Z¡dœ„Z¢d„Z£RS(Ÿs]An array object representing a multidimensional, homogeneous array of fixed-size items. g@@icC`s |jjS(N(R_R^(tself((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt _tvm_handle»scC`sRdjg|jD]}d|^qƒ}dt|jƒƒ|jj||jfS(s-Returns a string representation of the array.txs%ds %s <%s %s @%s>(tjoinRTtstrtasnumpyt __class__t__name__tcontext(RbRdt shape_info((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__repr__¿s) cC`std|jƒfS(N(N(RtNonet __getstate__(Rb((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt __reduce__ÆscC`sbtjƒ}tjƒ}ttj|jtj|ƒtj|ƒƒƒ|j|j|j|j fS(N( RFRMRRtMXNDArrayGetSharedMemHandleR_RGR^RTRR(RbRYRZ((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt_to_shared_memÉs    %cC`s t||ƒS(s)x.__add__(y) <=> x+y <=> mx.nd.add(x, y) (R(Rbtother((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__add__ÐscC`sˆ|jstdƒ‚nt|tƒr=tj||d|ƒSt|tƒrhtj|t |ƒd|ƒSt dt t |ƒƒƒ‚dS(sx.__iadd__(y) <=> x+=y s#trying to add to a readonly NDArraytoutstype %s not supportedN( twritablet ValueErrort isinstanceRRt broadcast_addRRt _plus_scalartfloatt TypeErrorRfRS(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__iadd__Ôs cC`s |j|ƒS(N(Rs(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__radd__ßscC`s t||ƒS(s.x.__sub__(y) <=> x-y <=> mx.nd.subtract(x, y) (R5(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__sub__âscC`sˆ|jstdƒ‚nt|tƒr=tj||d|ƒSt|tƒrhtj|t |ƒd|ƒSt dt t |ƒƒƒ‚dS(sx.__isub__(y) <=> x-=y s*trying to subtract from a readonly NDArrayRtstype %s not supportedN( RuRvRwRRt broadcast_subRRt _minus_scalarRzR{RfRS(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__isub__æs cC`s t||ƒS(s/x.__rsub__(y) <=> y-x <=> mx.nd.subtract(y, x) (R5(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__rsub__ñscC`s t||ƒS(s.x.__mul__(y) <=> x*y <=> mx.nd.multiply(x, y) (R1(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__mul__õscC`stj|dƒS(sx.__neg__(y) <=> -x gð¿(Rt _mul_scalar(Rb((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__neg__ùscC`sˆ|jstdƒ‚nt|tƒr=tj||d|ƒSt|tƒrhtj|t |ƒd|ƒSt dt t |ƒƒƒ‚dS(sx.__imul__(y) <=> x*=y s(trying to multiply to a readonly NDArrayRtstype %s not supportedN( RuRvRwRRt broadcast_mulRRR„RzR{RfRS(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__imul__ýs cC`s |j|ƒS(N(Rƒ(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__rmul__scC`s t||ƒS(s,x.__div__(y) <=> x/y <=> mx.nd.divide(x, y) (R"(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__div__ scC`s t||ƒS(s-x.__rdiv__(y) <=> y/x <=> mx.nd.divide(y, x) (R"(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__rdiv__scC`sˆ|jstdƒ‚nt|tƒr=tj||d|ƒSt|tƒrhtj|t |ƒd|ƒSt dt t |ƒƒƒ‚dS(sx.__rdiv__(y) <=> x/=y s(trying to divide from a readonly NDArrayRtstype %s not supportedN( RuRvRwRRt broadcast_divRRt _div_scalarRzR{RfRS(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__idiv__s cC`s t||ƒS(N(R"(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt __truediv__scC`s t||ƒS(N(R"(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt __rtruediv__!scC`s |j|ƒS(N(R(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt __itruediv__$scC`s t||ƒS(s,x.__mod__(y) <=> x%y <=> mx.nd.modulo(x, y) (R0(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__mod__'scC`s t||ƒS(s-x.__rmod__(y) <=> y%x <=> mx.nd.modulo(y, x) (R0(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__rmod__+scC`sˆ|jstdƒ‚nt|tƒr=tj||d|ƒSt|tƒrhtj|t |ƒd|ƒSt dt t |ƒƒƒ‚dS(sx.__rmod__(y) <=> x%=y s-trying to take modulo from a readonly NDArrayRtstype %s not supportedN( RuRvRwRRt broadcast_modRRt _mod_scalarRzR{RfRS(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__imod__/s cC`s t||ƒS(s+x.__pow__(y) <=> x**y <=> mx.nd.power(x,y) (R4(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__pow__:scC`s t||ƒS(s+x.__pow__(y) <=> y**x <=> mx.nd.power(y,x) (R4(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__rpow__>scC`s t||ƒS(s+x.__eq__(y) <=> x==y <=> mx.nd.equal(x, y) (R#(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__eq__BscC`st|ƒdS(sDefault hash function.i(tid(Rb((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__hash__FscC`s t||ƒS(s/x.__ne__(y) <=> x!=y <=> mx.nd.not_equal(x, y) (R2(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__ne__JscC`s t||ƒS(s,x.__gt__(y) <=> x>y <=> mx.nd.greater(x, y) (R%(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__gt__NscC`s t||ƒS(s3x.__ge__(y) <=> x>=y <=> mx.nd.greater_equal(x, y) (R&(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__ge__RscC`s t||ƒS(s+x.__lt__(y) <=> x mx.nd.lesser(x, y) (R((RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__lt__VscC`s t||ƒS(s0x.__le__(y) <=> x<=y <=> mx.nd.less_equal(x, y) (R)(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__le__ZscC`sTttj|jdƒ}|dkr(tS|dkrDt|jƒƒStdƒ‚dS(NiisBThe truth value of an NDArray with multiple elements is ambiguous.(RtoperatortmulRTtFalsetbooltasscalarRv(Rbt num_elements((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__bool__^s   cC`s |jdS(s'Number of element along the first axis.i(RT(Rb((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt__len__jscC`sŽ|j}idd6}|dk rŠtjƒ}tjtjƒƒ}ttj|jtj |ƒtj |ƒƒƒt ||j ƒ|d x[i]=y Sets value to self[key]. This functions supports advanced indexing defined in the following reference with some restrictions. https://docs.scipy.org/doc/numpy-1.13.0/reference/arrays.indexing.html#combining-advanced-and-basic-indexing - If key is a list type, only a list of integers is supported, e.g. key=[1, 2] is supported, while not for key=[[1, 2]]. - Ellipsis (...) and np.newaxis are not supported. - Boolean array indexing is not supported. Parameters ---------- key : int, mxnet.ndarray.slice, list, np.ndarray, NDArray, or tuple of all previous types The indexing key. value : scalar or array-like object that can be broadcast to the shape of self[key] The value to set. Examples -------- >>> x = mx.nd.zeros((2,3)) >>> x[:] = 1 >>> x.asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> x.asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> x[:,1:2] = 2 >>> x.asnumpy() array([[ 1., 2., 1.], [ 1., 2., 1.]], dtype=float32) >>> x[1:2,1:] = 3 >>> x.asnumpy() array([[ 1., 2., 1.], [ 1., 3., 3.]], dtype=float32) >>> x[1:,0:2] = mx.nd.zeros((1,2)) >>> x.asnumpy() array([[ 1., 2., 1.], [ 0., 0., 3.]], dtype=float32) >>> x[1,2] = 4 >>> x.asnumpy() array([[ 1., 2., 1.], [ 0., 0., 4.]], dtype=float32) >>> x[[0], [1, 2]] = 5 >>> x.asnumpy() array([[ 1., 5., 5.], [ 0., 0., 4.]], dtype=float32) >>> x[::-1, 0:2:2] = [6] >>> x.asnumpy() array([[ 6., 5., 5.], [ 6., 0., 4.]], dtype=float32) s;Indexing NDArray with index=%s and type=%s is not supportedN(t_get_indexing_dispatch_codet_NDARRAY_BASIC_INDEXINGt_set_nd_basic_indexingt_NDARRAY_ADVANCED_INDEXINGt_set_nd_advanced_indexingRvRfRS(RbtkeyR^tindexing_dispatch_code((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt __setitem__ˆs7   cC`sjt|ƒ}|tkr%|j|ƒS|tkr>|j|ƒStdt|ƒtt|ƒƒfƒ‚dS(sx.__getitem__(i) <=> x[i] Returns a sliced view of this array if the elements fetched are contiguous in memory; otherwise, returns a newly created NDArray. This functions supports advanced indexing defined in the following reference with some restrictions. https://docs.scipy.org/doc/numpy-1.13.0/reference/arrays.indexing.html#combining-advanced-and-basic-indexing - If key is a list type, only a list of integers is supported, e.g. key=[1, 2] is supported, while not for key=[[1, 2]]. - Ellipsis (...) and np.newaxis are not supported. - Boolean array indexing is not supported. Parameters ---------- key : int, mxnet.ndarray.slice, list, np.ndarray, NDArray, or tuple of all previous types Indexing key. Examples -------- >>> x = mx.nd.arange(0,6).reshape((2,3)) >>> x.asnumpy() array([[ 0., 1., 2.], [ 3., 4., 5.]], dtype=float32) >>> x[1].asnumpy() array([ 3., 4., 5.], dtype=float32) >>> y = x[0:1] >>> y[:] = 2 >>> x.asnumpy() array([[ 2., 2., 2.], [ 3., 4., 5.]], dtype=float32) >>> x = mx.nd.arange(0, 8, dtype='int32').reshape((2, 2, 2)) >>> x[[0, 1]] [[[0 1] [2 3]] [[4 5] [6 7]]] >>> x[1:, [0, 1]] [[[4 5] [6 7]]] >>> y = np.array([0, 1], dtype='int32') >>> x[1:, y] [[[4 5] [6 7]]] >>> y = mx.nd.array([0, 1], dtype='int32') >>> x[1:, y] [[[4 5] [6 7]]] s;Indexing NDArray with index=%s and type=%s is not supportedN(RµR¶t_get_nd_basic_indexingR¸t_get_nd_advanced_indexingRvRfRS(RbRºR»((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt __getitem__Ês3     c C`sd„}t|ttjtttfƒr6|f}nt|tƒsmtdt |ƒt t |ƒƒfƒ‚t |ƒdks‹tdƒ‚|j }t |ƒt |ƒksÎtdt |ƒt |ƒfƒ‚g}d}t |ƒdk}g}g}d } xýt|ƒD]ï\} } t} t| tjttfƒrct| d|jd |ƒ} |j| ƒn?t| tƒrÔt| j| j|| | jƒ\} }}t| ||d|jd |ƒ} |j| ƒt} nÎt| tƒr:t| | d|| dƒ\} }}t| ||d|jd |ƒ} |j| ƒnht| tƒrz|| jkrj| j|ƒ} n|j| ƒn(td t |ƒt t |ƒƒfƒ‚| rí| d krÀ| j } qí| | j krít}t| | j ƒ} qín|j| ƒq Wt |ƒdkr#td |ƒ‚nt}xGtdt |ƒdƒD],} || d|| dkrCt}PqCqCWg}|rCxRtd|dƒD]=} |j|| j ƒ| r“|| j | kr“t}q“q“W|j| ƒx´t|d dt |ƒƒD]=} | r(|| j | kr(t}n|j|| j ƒqÿWnU|j| ƒxE|D]=} |j|| j ƒ| rW|| j | krWt}qWqWWt|ƒ}|rg}dgt |ƒ}|r|d}|t | ƒ}x"t|ƒD]%\} }||ƒrJ|}x´|| j d d d …D]}|d8}|||>> a = mx.nd.array([1, 2]) >>> a.asnumpy() array([ 1., 2.], dtype=float32) >>> a[:] = np.array([3, 4]) >> a.asnumpy() array([ 3., 4.], dtype=float32) RRs&array must consist of array-like data,stype %s is not supportedtordertCs)Shape inconsistent: expected %s vs got %sN(RwRQRÄRRRR{RfRStasarrayRTRvRRtMXNDArraySyncCopyFromCPUR_RFtdata_astc_void_pR¨tsize(Rbt source_array((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRøNs!% cC`sutƒ}t|||jdƒ\}}}ttj|jt|ƒt|ƒtj |ƒƒƒt d|d|j ƒS(sÆReturns a sliced NDArray that shares memory with the current one. This is called through ``x[start:stop]``. Parameters ---------- start : int Starting inclusive index of slice in the first dim. stop : int Finishing exclusive index of slice in the first dim. Returns ------- `NDArray` sharing the memory with the current one sliced from start to stop in the first dim. Examples: >>> a = mx.nd.array([[1,2], [3, 4], [5, 6], [7, 8]]) >>> a[1:2].asnumpy() array([[ 3., 4.]], dtype=float32) >>> a[1:1].asnumpy() array([], shape=(0, 2), dtype=float32) iR_Ru( RRËRTRRtMXNDArraySliceR_R RFRGRRu(RbRÌRÍR_Rê((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRss  " +cC`s™tƒ}|dkrX|jd}||7}|dkrXtd|||fƒ‚qXnttj|jt|ƒtj |ƒƒƒt d|d|j ƒS(svReturns a view of the array sliced at `idx` in the first dim. This is called through ``x[idx]``. Parameters ---------- idx : int index for slicing the `NDArray` in the first dim. Returns ------- NDArray `NDArray` sharing the memory with the current one sliced at `idx` in the first dim. Examples -------- >>> a = mx.nd.array([[1,2], [3, 4]]) >>> a[1].asnumpy() array([ 3., 4.], dtype=float32) >>> b = mx.nd.array([1, 2, 3, 4]) >>> b[0].asnumpy() array([ 1.], dtype=float32) is1index %d is out of bounds for axis 0 with size %dR_Ru( RRTRÐRRt MXNDArrayAtR_R RFRGRRu(RbRæR_R­((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR‘s      "cO`s&t|ƒdkr8t|dttfƒr8|d}n*|sb|jdƒ}|sbtdƒ‚ntd„|Dƒƒs¸tdjdj g|D]}|d krŽ|^qŽƒƒƒ‚n|jdt ƒ}t ƒ}t t j|jt|ƒttj|ƒ|tj|ƒƒƒtd |d |jƒS( s1Returns a **view** of this array with a new shape without altering any data. Parameters ---------- shape : tuple of int, or n ints The new shape should not change the array size, namely ``np.prod(new_shape)`` should be equal to ``np.prod(self.shape)``. Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below: - ``0`` copy this dimension from the input to the output shape. Example:: - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2) - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4) - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions keeping the size of the new array same as that of the input array. At most one dimension of shape can be -1. Example:: - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4) - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8) - input shape = (2,3,4), shape=(-1,), output shape = (24,) - ``-2`` copy all/remainder of the input dimensions to the output shape. Example:: - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4) - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4) - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1) - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension. Example:: - input shape = (2,3,4), shape = (-3,4), output shape = (6,4) - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20) - input shape = (2,3,4), shape = (0,-3), output shape = (2,12) - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4) - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1). Example:: - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4) - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4) - If the argument `reverse` is set to 1, then the special values are inferred from right to left. Example:: - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5). - with reverse=1, output shape will be (50,4). reverse : bool, default False If true then the special values are inferred from right to left. Only supported as keyword argument. Returns ------- NDArray An array with desired shape that shares data with this array. Examples -------- >>> x = mx.nd.arange(0,6).reshape(2,3) >>> x.asnumpy() array([[ 0., 1., 2.], [ 3., 4., 5.]], dtype=float32) >>> y = x.reshape(3,2) >>> y.asnumpy() array([[ 0., 1.], [ 2., 3.], [ 4., 5.]], dtype=float32) >>> y = x.reshape(3,-1) >>> y.asnumpy() array([[ 0., 1.], [ 2., 3.], [ 4., 5.]], dtype=float32) >>> y = x.reshape(3,2) >>> y.asnumpy() array([[ 0., 1.], [ 2., 3.], [ 4., 5.]], dtype=float32) >>> y = x.reshape(-3) >>> y.asnumpy() array([ 0. 1. 2. 3. 4. 5.], dtype=float32) >>> y[:] = -1 >>> x.asnumpy() array([[-1., -1., -1.], [-1., -1., -1.]], dtype=float32) iiRTsShape must be provided.cs`s|]}|dkVqdS(RTtreverseN(RTR((t.0Rç((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pys ssZGot unknown keywords in reshape: {}. Accepted keyword arguments are 'shape' and 'reverse'.s, RR_Ru(RTR(RLRwRÅRÆtgetRÇtallR{RReR¢RRRtMXNDArrayReshape64R_R RFtc_int64RGRRu(RbRTtkwargsRçRR_((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRÔ³s"f+ 7  cO`stj|||ŽS(s¤Convenience fluent method for :py:func:`reshape_like`. The arguments are the same as for :py:func:`reshape_like`, with this array as data. (Rt reshape_like(RbtargsR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR.scO`stj|||ŽS(s Convenience fluent method for :py:func:`zeros_like`. The arguments are the same as for :py:func:`zeros_like`, with this array as data. (Rt zeros_like(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR 6scO`stj|||ŽS(sžConvenience fluent method for :py:func:`ones_like`. The arguments are the same as for :py:func:`ones_like`, with this array as data. (Rt ones_like(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR!>scO`stj|||ŽS(s¨Convenience fluent method for :py:func:`broadcast_axes`. The arguments are the same as for :py:func:`broadcast_axes`, with this array as data. (Rtbroadcast_axes(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR"FscO`stj|||ŽS(s˜Convenience fluent method for :py:func:`repeat`. The arguments are the same as for :py:func:`repeat`, with this array as data. (Rtrepeat(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR#NscO`stj|||ŽS(s’Convenience fluent method for :py:func:`pad`. The arguments are the same as for :py:func:`pad`, with this array as data. (Rtpad(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR$VscO`stj|||ŽS(sœConvenience fluent method for :py:func:`swapaxes`. The arguments are the same as for :py:func:`swapaxes`, with this array as data. (Rtswapaxes(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR%^scO`stj|||ŽS(s–Convenience fluent method for :py:func:`split`. The arguments are the same as for :py:func:`split`, with this array as data. (Rtsplit(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR&fscO`st|||ŽS(sœConvenience fluent method for :py:func:`split_v2`. The arguments are the same as for :py:func:`split_v2`, with this array as data. (R:(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR:nscO`stj|||ŽS(s–Convenience fluent method for :py:func:`slice`. The arguments are the same as for :py:func:`slice`, with this array as data. (RR(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRvscO`stj|||ŽS(s Convenience fluent method for :py:func:`slice_axis`. The arguments are the same as for :py:func:`slice_axis`, with this array as data. (Rt slice_axis(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR'~scO`stj|||ŽS(s Convenience fluent method for :py:func:`slice_like`. The arguments are the same as for :py:func:`slice_like`, with this array as data. (Rt slice_like(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR(†scO`stj|||ŽS(s”Convenience fluent method for :py:func:`take`. The arguments are the same as for :py:func:`take`, with this array as data. (Rttake(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR)ŽscO`stj|||ŽS(sšConvenience fluent method for :py:func:`one_hot`. The arguments are the same as for :py:func:`one_hot`, with this array as data. (Rtone_hot(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR*–scO`stj|||ŽS(s”Convenience fluent method for :py:func:`pick`. The arguments are the same as for :py:func:`pick`, with this array as data. (Rtpick(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR+žscO`stj|||ŽS(s”Convenience fluent method for :py:func:`sort`. The arguments are the same as for :py:func:`sort`, with this array as data. (Rtsort(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR,¦scO`stj|||ŽS(s”Convenience fluent method for :py:func:`topk`. The arguments are the same as for :py:func:`topk`, with this array as data. (Rttopk(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR-®scO`stj|||ŽS(sšConvenience fluent method for :py:func:`argsort`. The arguments are the same as for :py:func:`argsort`, with this array as data. (Rtargsort(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR.¶scO`stj|||ŽS(s˜Convenience fluent method for :py:func:`argmax`. The arguments are the same as for :py:func:`argmax`, with this array as data. (Rtargmax(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR/¾scO`stj|||ŽS(s¨Convenience fluent method for :py:func:`argmax_channel`. The arguments are the same as for :py:func:`argmax_channel`, with this array as data. (Rtargmax_channel(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR0ÆscO`stj|||ŽS(s˜Convenience fluent method for :py:func:`argmin`. The arguments are the same as for :py:func:`argmin`, with this array as data. (Rtargmin(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR1ÎscO`stj|||ŽS(s”Convenience fluent method for :py:func:`clip`. The arguments are the same as for :py:func:`clip`, with this array as data. (Rtclip(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR2ÖscO`stj|||ŽS(s’Convenience fluent method for :py:func:`abs`. The arguments are the same as for :py:func:`abs`, with this array as data. (Rtabs(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR3ÞscO`stj|||ŽS(s”Convenience fluent method for :py:func:`sign`. The arguments are the same as for :py:func:`sign`, with this array as data. (Rtsign(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR4æscO`stj|||ŽS(sšConvenience fluent method for :py:func:`flatten`. The arguments are the same as for :py:func:`flatten`, with this array as data. (Rtflatten(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR5îscO`stj|||ŽS(s¢Convenience fluent method for :py:func:`shape_array`. The arguments are the same as for :py:func:`shape_array`, with this array as data. (Rt shape_array(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR6öscO`stj|||ŽS(s Convenience fluent method for :py:func:`size_array`. The arguments are the same as for :py:func:`size_array`, with this array as data. (Rt size_array(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR7þscO`stj|||ŽS(s¢Convenience fluent method for :py:func:`expand_dims`. The arguments are the same as for :py:func:`expand_dims`, with this array as data. (Rt expand_dims(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR8scO`stj|||ŽS(s”Convenience fluent method for :py:func:`tile`. The arguments are the same as for :py:func:`tile`, with this array as data. (Rttile(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR9scO`stj|||ŽS(sžConvenience fluent method for :py:func:`transpose`. The arguments are the same as for :py:func:`transpose`, with this array as data. (Rt transpose(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR:scO`stj|||ŽS(s”Convenience fluent method for :py:func:`flip`. The arguments are the same as for :py:func:`flip`, with this array as data. (Rtflip(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR;scO`stj|||ŽS(s¨Convenience fluent method for :py:func:`depth_to_space`. The arguments are the same as for :py:func:`depth_to_space`, with this array as data. (Rtdepth_to_space(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR<&scO`stj|||ŽS(s¨Convenience fluent method for :py:func:`space_to_depth`. The arguments are the same as for :py:func:`space_to_depth`, with this array as data. (Rtspace_to_depth(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR=.sicK`stj|||S(s”Convenience fluent method for :py:func:`diag`. The arguments are the same as for :py:func:`diag`, with this array as data. (Rtdiag(RbRçR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR>6scO`stj|||ŽS(s’Convenience fluent method for :py:func:`sum`. The arguments are the same as for :py:func:`sum`, with this array as data. (Rtsum(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR?>scO`stj|||ŽS(s˜Convenience fluent method for :py:func:`nansum`. The arguments are the same as for :py:func:`nansum`, with this array as data. (Rtnansum(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR@FscO`stj|||ŽS(s”Convenience fluent method for :py:func:`prod`. The arguments are the same as for :py:func:`prod`, with this array as data. (RR(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRNscO`stj|||ŽS(sšConvenience fluent method for :py:func:`nanprod`. The arguments are the same as for :py:func:`nanprod`, with this array as data. (Rtnanprod(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRAVscO`stj|||ŽS(s”Convenience fluent method for :py:func:`mean`. The arguments are the same as for :py:func:`mean`, with this array as data. (Rtmean(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRB^scO`stj|||ŽS(s’Convenience fluent method for :py:func:`max`. The arguments are the same as for :py:func:`max`, with this array as data. (Rtmax(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRCfscO`stj|||ŽS(s’Convenience fluent method for :py:func:`min`. The arguments are the same as for :py:func:`min`, with this array as data. (Rtmin(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRDnscO`stj|||ŽS(s”Convenience fluent method for :py:func:`norm`. The arguments are the same as for :py:func:`norm`, with this array as data. (Rtnorm(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyREvscO`stj|||ŽS(s–Convenience fluent method for :py:func:`round`. The arguments are the same as for :py:func:`round`, with this array as data. (Rtround(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRF~scO`stj|||ŽS(s”Convenience fluent method for :py:func:`rint`. The arguments are the same as for :py:func:`rint`, with this array as data. (Rtrint(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRG†scO`stj|||ŽS(s’Convenience fluent method for :py:func:`fix`. The arguments are the same as for :py:func:`fix`, with this array as data. (Rtfix(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRHŽscO`stj|||ŽS(s–Convenience fluent method for :py:func:`floor`. The arguments are the same as for :py:func:`floor`, with this array as data. (Rtfloor(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRI–scO`stj|||ŽS(s”Convenience fluent method for :py:func:`ceil`. The arguments are the same as for :py:func:`ceil`, with this array as data. (Rtceil(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRJžscO`stj|||ŽS(s–Convenience fluent method for :py:func:`trunc`. The arguments are the same as for :py:func:`trunc`, with this array as data. (Rttrunc(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRK¦scO`stj|||ŽS(s’Convenience fluent method for :py:func:`sin`. The arguments are the same as for :py:func:`sin`, with this array as data. (Rtsin(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRL®scO`stj|||ŽS(s’Convenience fluent method for :py:func:`cos`. The arguments are the same as for :py:func:`cos`, with this array as data. (Rtcos(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRM¶scO`stj|||ŽS(s’Convenience fluent method for :py:func:`tan`. The arguments are the same as for :py:func:`tan`, with this array as data. (Rttan(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRN¾scO`stj|||ŽS(s˜Convenience fluent method for :py:func:`arcsin`. The arguments are the same as for :py:func:`arcsin`, with this array as data. (Rtarcsin(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyROÆscO`stj|||ŽS(s˜Convenience fluent method for :py:func:`arccos`. The arguments are the same as for :py:func:`arccos`, with this array as data. (Rtarccos(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRPÎscO`stj|||ŽS(s˜Convenience fluent method for :py:func:`arctan`. The arguments are the same as for :py:func:`arctan`, with this array as data. (Rtarctan(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRQÖscO`stj|||ŽS(sšConvenience fluent method for :py:func:`degrees`. The arguments are the same as for :py:func:`degrees`, with this array as data. (Rtdegrees(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRRÞscO`stj|||ŽS(sšConvenience fluent method for :py:func:`radians`. The arguments are the same as for :py:func:`radians`, with this array as data. (Rtradians(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRSæscO`stj|||ŽS(s”Convenience fluent method for :py:func:`sinh`. The arguments are the same as for :py:func:`sinh`, with this array as data. (Rtsinh(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRTîscO`stj|||ŽS(s”Convenience fluent method for :py:func:`cosh`. The arguments are the same as for :py:func:`cosh`, with this array as data. (Rtcosh(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRUöscO`stj|||ŽS(s”Convenience fluent method for :py:func:`tanh`. The arguments are the same as for :py:func:`tanh`, with this array as data. (Rttanh(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRVþscO`stj|||ŽS(sšConvenience fluent method for :py:func:`arcsinh`. The arguments are the same as for :py:func:`arcsinh`, with this array as data. (Rtarcsinh(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRWscO`stj|||ŽS(sšConvenience fluent method for :py:func:`arccosh`. The arguments are the same as for :py:func:`arccosh`, with this array as data. (Rtarccosh(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRXscO`stj|||ŽS(sšConvenience fluent method for :py:func:`arctanh`. The arguments are the same as for :py:func:`arctanh`, with this array as data. (Rtarctanh(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRYscO`stj|||ŽS(s’Convenience fluent method for :py:func:`exp`. The arguments are the same as for :py:func:`exp`, with this array as data. (Rtexp(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRZscO`stj|||ŽS(s–Convenience fluent method for :py:func:`expm1`. The arguments are the same as for :py:func:`expm1`, with this array as data. (Rtexpm1(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR[&scO`stj|||ŽS(s’Convenience fluent method for :py:func:`log`. The arguments are the same as for :py:func:`log`, with this array as data. (Rtlog(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR\.scO`stj|||ŽS(s–Convenience fluent method for :py:func:`log10`. The arguments are the same as for :py:func:`log10`, with this array as data. (Rtlog10(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR]6scO`stj|||ŽS(s”Convenience fluent method for :py:func:`log2`. The arguments are the same as for :py:func:`log2`, with this array as data. (Rtlog2(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR^>scO`stj|||ŽS(s–Convenience fluent method for :py:func:`log1p`. The arguments are the same as for :py:func:`log1p`, with this array as data. (Rtlog1p(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR_FscO`stj|||ŽS(s”Convenience fluent method for :py:func:`sqrt`. The arguments are the same as for :py:func:`sqrt`, with this array as data. (Rtsqrt(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR`NscO`stj|||ŽS(s–Convenience fluent method for :py:func:`rsqrt`. The arguments are the same as for :py:func:`rsqrt`, with this array as data. (Rtrsqrt(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRaVscO`stj|||ŽS(s”Convenience fluent method for :py:func:`cbrt`. The arguments are the same as for :py:func:`cbrt`, with this array as data. (Rtcbrt(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRb^scO`stj|||ŽS(s–Convenience fluent method for :py:func:`rcbrt`. The arguments are the same as for :py:func:`rcbrt`, with this array as data. (Rtrcbrt(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRcfscO`stj|||ŽS(s˜Convenience fluent method for :py:func:`square`. The arguments are the same as for :py:func:`square`, with this array as data. (Rtsquare(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRdnscO`stj|||ŽS(s Convenience fluent method for :py:func:`reciprocal`. The arguments are the same as for :py:func:`reciprocal`, with this array as data. (Rt reciprocal(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRevscO`stj|||ŽS(s”Convenience fluent method for :py:func:`relu`. The arguments are the same as for :py:func:`relu`, with this array as data. (Rtrelu(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRf~scO`stj|||ŽS(sšConvenience fluent method for :py:func:`sigmoid`. The arguments are the same as for :py:func:`sigmoid`, with this array as data. (Rtsigmoid(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRg†scO`stj|||ŽS(sšConvenience fluent method for :py:func:`softmax`. The arguments are the same as for :py:func:`softmax`, with this array as data. (Rtsoftmax(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRhŽscO`stj|||ŽS(s¢Convenience fluent method for :py:func:`log_softmax`. The arguments are the same as for :py:func:`log_softmax`, with this array as data. (Rt log_softmax(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRi–scO`stj|||ŽS(sšConvenience fluent method for :py:func:`softmin`. The arguments are the same as for :py:func:`softmin`, with this array as data. (Rtsoftmin(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRjžscO`stj|||ŽS(sšConvenience fluent method for :py:func:`squeeze`. The arguments are the same as for :py:func:`squeeze`, with this array as data. (Rtsqueeze(RbRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRk¦scC`sú|j}dj||ƒ}t|ƒt|ƒkrBt|ƒ‚ndt|ƒt|ƒ|}tj|ƒ}tj|tj|ƒkƒ}||dkjƒr²t|ƒ‚n||jkrÝtj |j |ƒd|ƒStj |dt |ƒƒSdS(sKBroadcasts the input array to a new shape. Broadcasting is only allowed on axes with size 1. The new shape cannot change the number of dimensions. For example, you could broadcast from shape (2, 1) to (2, 3), but not from shape (2, 3) to (2, 3, 3). Parameters ---------- shape : tuple of int The shape of the desired array. Returns ------- NDArray A NDArray with the desired shape that is not sharing data with this array, even if the new shape is the same as ``self.shape``. Examples -------- >>> x = mx.nd.arange(0,3).reshape((1,3,1)) >>> x.asnumpy() array([[[ 0.], [ 1.], [ 2.]]], dtype=float32) >>> y = x.broadcast_to((2,3,3)) >>> y.asnumpy() array([[[ 0., 0., 0.], [ 1., 1., 1.], [ 2., 2., 2.]], [[ 0., 0., 0.], [ 1., 1., 1.], [ 2., 2., 2.]]], dtype=float32) sloperands could not be broadcast together with remapped shapes[original->remapped]: {} and requested shape {}iRTN(i( RTRRLRvRQRtnonzerotanyRRÕRÔRÆ(RbRTt cur_shapeterr_strt cur_shape_arrtbroadcasting_axes((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRÕ¯s$  cC`s|j|jƒS(sbBroadcasts the input array to the shape of other. Broadcasting is only allowed on axes with size 1. The new shape cannot change the number of dimensions. For example, you could broadcast from shape (2, 1) to (2, 3), but not from shape (2, 3) to (2, 3, 3). Parameters ---------- other : NDArray Array with shape of the desired array. Returns ------- NDArray A NDArray with the desired shape that is not sharing data with this array, even if the new shape is the same as ``self.shape``. Examples -------- >>> x = mx.nd.arange(0,3).reshape((1,3,1)) >>> x.asnumpy() array([[[ 0.], [ 1.], [ 2.]]], dtype=float32) >>> y = x.broadcast_like(mx.nd.ones((2,3,3))) >>> y.asnumpy() array([[[ 0., 0., 0.], [ 1., 1., 1.], [ 2., 2., 2.]], [[ 0., 0., 0.], [ 1., 1., 1.], [ 2., 2., 2.]]], dtype=float32) (RÕRT(RbRr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pytbroadcast_likeãs$cC`sttj|jƒƒdS(sKWaits until all previous write operations on the current array are finished. This method guarantees that all previous write operations that pushed into the backend engine for execution are actually finished. Examples -------- >>> import time >>> tic = time.time() >>> a = mx.nd.ones((1000,1000)) >>> b = mx.nd.dot(a, a) >>> print(time.time() - tic) # doctest: +SKIP 0.003854036331176758 >>> b.wait_to_read() >>> print(time.time() - tic) # doctest: +SKIP 0.0893700122833252 N(RRtMXNDArrayWaitToReadR_(Rb((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt wait_to_read scC`s t|jƒS(sìReturns the number of dimensions of this array Examples -------- >>> x = mx.nd.array([1, 2, 3, 4]) >>> x.ndim 1 >>> x = mx.nd.array([[1, 2], [3, 4]]) >>> x.ndim 2 (RLRT(Rb((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pytndims cC`sqtƒ}tjtƒƒ}ttj|jtj|ƒtj|ƒƒƒ|jdkr\dSt ||j ƒSdS(sâTuple of array dimensions. Examples -------- >>> x = mx.nd.array([1, 2, 3, 4]) >>> x.shape (4L,) >>> y = mx.nd.zeros((2, 3, 4)) >>> y.shape (2L, 3L, 4L) iÿÿÿÿN( RRFR©RRtMXNDArrayGetShapeExR_RGR^RmRÆ(RbRutpdata((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRT,s  %cC`s(d}x|jD]}||9}qW|S(sNumber of elements in the array. Equivalent to the product of the array's dimensions. Examples -------- >>> import numpy as np >>> x = mx.nd.zeros((3, 5, 2)) >>> x.size 30 >>> np.prod(x.shape) 30 i(RT(RbRRÜ((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRCscC`s`tjƒ}tjƒ}ttj|jtj|ƒtj|ƒƒƒttj|j |j ƒS(s.Device context of the array. Examples -------- >>> x = mx.nd.array([1, 2, 3, 4]) >>> x.context cpu(0) >>> type(x.context) >>> y = mx.nd.zeros((2,3), mx.gpu(0)) >>> y.context gpu(0) ( RFRMRRtMXNDArrayGetContextR_RGRt devtype2strR^(Rbt dev_typeidtdev_id((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRjWs    %cC`s9tjƒ}ttj|jtj|ƒƒƒt|jS(sbData-type of the array's elements. Returns ------- numpy.dtype This NDArray's data type. Examples -------- >>> x = mx.nd.zeros((2,3)) >>> x.dtype >>> y = mx.nd.zeros((2,3), dtype='int32') >>> y.dtype ( RFRMRRtMXNDArrayGetDTypeR_RGRR^(Rbtmx_dtype((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRRls  cC`stt|jƒS(s#Storage-type of the array. (t_STORAGE_TYPE_ID_TO_STRRaR_(Rb((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pytstypeƒscC`s&t|jƒdkr|Stj|ƒS(sbReturns a copy of the array with axes transposed. Equivalent to ``mx.nd.transpose(self)`` except that self is returned if ``self.ndim < 2``. Unlike ``numpy.ndarray.T``, this function returns a copy rather than a view of the array unless ``self.ndim < 2``. Examples -------- >>> x = mx.nd.arange(0,6).reshape((2,3)) >>> x.asnumpy() array([[ 0., 1., 2.], [ 3., 4., 5.]], dtype=float32) >>> x.T.asnumpy() array([[ 0., 3.], [ 1., 4.], [ 2., 5.]], dtype=float32) i(RLRTRR:(Rb((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pytT‰scC`s5tjƒ}ttj|jtj|ƒƒƒ|jS(s5Whether this array's corresponding gradient array (registered via `autograd.mark_variables`) has been updated by `autograd.backward` since last reset. `_fresh_grad` need to be manually set to False after consuming gradient (usually after updating this array). (RFRMRRtMXNDArrayGetGradStateR_RGR^(RbRt((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt _fresh_grad¥s "cC`s&ttj|jtj|ƒƒƒdS(N(RRtMXNDArraySetGradStateR_RFRM(RbR±((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR‚³scC`sVtj|jd|jƒ}ttj|j|jj tj ƒtj |j ƒƒƒ|S(sËReturns a ``numpy.ndarray`` object with value copied from this array. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = x.asnumpy() >>> type(y) >>> y array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> z = mx.nd.ones((2,3), dtype='int32') >>> z.asnumpy() array([[1, 1, 1], [1, 1, 1]], dtype=int32) RR( RQtemptyRTRRRRtMXNDArraySyncCopyToCPUR_RFRRR¨R(Rbtdata((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRg·s  cC`s,|jdkrtdƒ‚n|jƒdS(sTReturns a scalar whose value is copied from this array. This function is equivalent to ``self.asnumpy()[0]``. This NDArray must have shape (1,). Examples -------- >>> x = mx.nd.ones((1,), dtype='int32') >>> x.asscalar() 1 >>> type(x.asscalar()) is!The current array is not a scalari(i(RTRvRg(Rb((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR¤Ïs cC`sR| r#tj|ƒ|jkr#|St|jd|jd|ƒ}|j|ƒ|S(sƒReturns a copy of the array after casting to a specified type. Parameters ---------- dtype : numpy.dtype or str The type of the returned array. copy : bool Default `True`. By default, astype always returns a newly allocated ndarray on the same context. If this is set to `False`, and the dtype requested is the same as the ndarray's dtype, the ndarray is returned instead of a copy. Returns ------- NDArray, CSRNDArray or RowSparseNDArray The copied array after casting to the specified type, or the same array if copy=False and dtype is the same as the input array. Examples -------- >>> x = mx.nd.zeros((2,3), dtype='float32') >>> y = x.astype('int32') >>> y.dtype RURR(RQRRR„RTRjRõ(RbRRtcopytres((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRÏàs  cC`s«t|tƒrH|j|jkr5tjdtƒtStj|d|ƒSt|t ƒr‹tt |j |t |j ƒƒ}tj|d|ƒStdtt|ƒƒƒ‚dS(s0Copies the value of this array to another array. If ``other`` is a ``NDArray`` object, then ``other.shape`` and ``self.shape`` should be the same. This function copies the value from ``self`` to ``other``. If ``other`` is a context, a new ``NDArray`` will be first created on the target context, and the value of ``self`` is copied. Parameters ---------- other : NDArray or Context The destination array or context. Returns ------- NDArray, CSRNDArray or RowSparseNDArray The copied array. If ``other`` is an ``NDArray``, then the return value and ``other`` will point to the same ``NDArray``. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = mx.nd.zeros((2,3), mx.gpu(0)) >>> z = x.copyto(y) >>> z is y True >>> y.asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> y.copyto(mx.gpu(0)) s-You are attempting to copy an array to itselfRtscopyto does not support type N(RwRR_twarningstwarntRuntimeWarningR¢Rt_copytoRRWRTRÉRRR{RfRS(RbRrthret((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRõs#!cC`s|j|jƒS(sxMakes a copy of this ``NDArray``, keeping the same context. Returns ------- NDArray, CSRNDArray or RowSparseNDArray The copied array Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = x.copy() >>> y.asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) (RõRj(Rb((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR‡1scC`s |j|kr|S|j|ƒS(s|Returns an array on the target device with the same value as this array. If the target context is the same as ``self.context``, then ``self`` is returned. Otherwise, a copy is made. Parameters ---------- context : Context The target context. Returns ------- NDArray, CSRNDArray or RowSparseNDArray The target array. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = x.as_in_context(mx.cpu()) >>> y is x True >>> z = x.as_in_context(mx.gpu(0)) >>> z is x False (RjRõ(RbRj((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRîCsRDcC`s”ddlm}|dk r4||jd|ƒ}ntj|ƒ}t|}ttj dt j |j ƒt j t |ƒƒt j |j ƒƒƒdS(sMAttach a gradient buffer to this NDArray, so that `backward` can compute gradient with respect to it. Parameters ---------- grad_req : {'write', 'add', 'null'} How gradient will be accumulated. - 'write': gradient will be overwritten on every backward. - 'add': gradient will be added to existing value on every backward. - 'null': do not compute gradient for this NDArray. stype : str, optional The storage type of the gradient array. Defaults to the same stype of this NDArray. i(tzerosRN(tRŽRmRTRR RRRtMXAutogradMarkVariablesRFtpointerR_R (Rbtgrad_reqRt_zerostgrad((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt attach_gradbs   cC`sXddlm}tƒ}ttj|jtj|ƒƒƒ|j dkrNdS||ƒS(s1Returns gradient buffer attached to this NDArray.i(t _ndarray_clsN( RR–RRRtMXNDArrayGetGradR_RFRGR^Rm(RbR–RH((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR”{s  "cC`sEddlm}tƒ}ttj|jtj|ƒƒƒ||ƒS(s7Returns a new NDArray, detached from the current graph.i(R–( RR–RRRtMXNDArrayDetachR_RFRG(RbR–RH((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pytdetach…s "c C`s¤|dkrtdƒg}n |jg}ttjdt|gƒtt|ƒdtj dƒtj |ƒtj dƒtj |ƒtj dƒtj dƒƒ ƒdS(séCompute the gradients of this NDArray w.r.t variables. Parameters ---------- out_grad : NDArray, optional Gradient with respect to head. retain_graph : bool, optional Whether to retain the computaion graph for another backward pass on the same graph. By default the computaion history is cleared. train_mode : bool, optional Whether to compute gradient for training or inference. iiN( RmRR_RRtMXAutogradBackwardExR R RFRRM(Rbtout_gradt retain_grapht train_modet ograd_handles((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pytbackwardŒs         cC`stj|d|ƒS(sReturn a copy of the array with chosen storage type. See Also ---------- :meth:`mxnet.ndarray.cast_storage`. Returns ------- NDArray, CSRNDArray or RowSparseNDArray A copy of the array with the chosen storage stype R(Rt cast_storage(RbR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyttostypeªs cC`s t|ƒS(sYReturns a reference view of NDArray that represents as DLManagedTensor until all previous write operations on the current array are finished. Returns ------- PyCapsule (the pointer of DLManagedTensor) a reference view of NDArray that represents as DLManagedTensor. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = mx.nd.to_dlpack_for_read(x) >>> type(y) >>> z = mx.nd.from_dlpack(y) >>> z [[1. 1. 1.] [1. 1. 1.]] (R;(Rb((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR;¸scC`s t|ƒS(srReturns a reference view of NDArray that represents as DLManagedTensor until all previous read/write operations on the current array are finished. Returns ------- PyCapsule (the pointer of DLManagedTensor) a reference view of NDArray that represents as DLManagedTensor. Examples -------- >>> x = mx.nd.ones((2,3)) >>> w = mx.nd.to_dlpack_for_write(x) >>> type(w) >>> u = mx.nd.from_dlpack(w) >>> u += 1 >>> x [[2. 2. 2.] [2. 2. 2.]] (R<(Rb((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR<ÏsN(¤Rit __module__t__doc__t __slots__t__array_priority__t _tvm_tcodetpropertyRcRlRoRqRsR|R}R~RR‚RƒR…R‡RˆR‰RŠRRŽRRR‘R’R•R–R—R˜RšR›RœRRžRŸR¦t __nonzero__R§RnR´R¼R¿RìRñR·R¹R½R¾RøRRRÔRR R!R"R#R$R%R&R:RR'R(R)R*R+R,R-R.R/R0R1R2R3R4R5R6R7R8R9R:R;R<R=R>R?R@RRARBRCRDRERFRGRHRIRJRKRLRMRNRORPRQRRRSRTRURVRWRXRYRZR[R\R]R^R_R`RaRbRcRdReRfRgRhRiRjRkRÕRrRtRuRTRRjRRRR€R‚tsetterRgR¤RÉRÏRõR‡RîRmR•R”R™R¢RŸR¡R;R<(((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR¯s<                              B = ’  T  A  %  " {                                                                                4 &    # .     cC`s!t|ttjfƒrtSt|tƒrzxH|D]@}t|tƒs2tdt|ƒtt |ƒƒfƒ‚q2q2WtSt|tt fƒr“t St|t ƒrxp|D]h}t|ttjtt fƒrÑtSt|t tfƒs©t dt|ƒtt |ƒƒfƒ‚q©q©Wt StSdS(sIReturns a dispatch code for calling basic or advanced indexing functions.ssIndexing NDArray only supports a list of integers as index when key is of list type, received element=%s of type=%ss8NDArray does not support slicing with key %s of type %s.N(RwRRQRÄR¸RÅRR{RfRSRÀR¶RÆRvt_NDARRAY_UNSUPPORTED_INDEXING(RºRÜRæ((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRµçs& ) )cC`s~|dkrtdƒ‚n|dkr6tdƒ‚n|dkrKd}n|dkry|dkrld}qà|d}ng|dkr»||7}|dkràtd|||fƒ‚qàn%||kràtd||fƒ‚n|dkr |dkr|}qqd}ng|dkrL||7}|dkrqtd|||fƒ‚qqn%||krqtd||fƒ‚n|||fS( sŠGiven start, stop, step and array length, return absolute values of start, stop, and step for generating index range. The returned values have been compensated by adding length if they are less than zero for all the cases but slice(None, None, -1). Note that the returned value of stop is not necessarily >= 0, since absolute stop is -1 in the case of slice(None, None, -1).isstep size cannot be zeros%array length cannot be less than zerois$Slicing start %d exceeds limit of %diÿÿÿÿs#Slicing stop %d exceeds limit of %dN(RvRmRÐ(RÌRÍR­RÎ((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRË s6                      cC`srt|ƒdkr$t|ƒdks*t‚t|dƒ}|dt|ƒkrh|j||dƒnt|ƒS(sGiven data and index shapes, get the output `NDArray` shape. This basically implements the infer shape logic of op gather_nd.ii(RLRÇRÅRÓRÆ(tdshapetishapeRþ((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR, s *cC`sv|dkst‚|dkrI||ks0t‚||d|d}n)||ks[t‚||d| d}|S(sPGiven start, stop, and stop, calculate the number of elements of this slice.ii(RÇ(RÌRÍRÎRè((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRù6 s cC`s||kr|St|ƒ}t|ƒ}||krCt|ƒ}n t|ƒ}t||ƒd}x‘t|ddd…|ddd…ƒD]f\}}|dkrÕ|dkrÕ||krÕtd||fƒ‚nt||ƒ||<|d8}qŒWt|ƒS(sdGiven two shapes that are not identical, find the shape that both input shapes can broadcast to.iNiÿÿÿÿs+shape1=%s is not broadcastable to shape2=%s(RLRÅRCtzipRvRÆ(tshape1tshape2tlength1tlength2RTRÜtatb((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRÑC s     6$cC`stj||d|ƒS(stOne-hot encoding indices into matrix out. .. note:: `onehot_encode` is deprecated. Use `one_hot` instead. Rt(Rt_onehot_encode(R×Rt((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR3X scK`sO|dkrtƒ}n|dkr*tn|}tjd|d|d||S(s`Returns a new array filled with all ones, with the given shape and type. Parameters ---------- shape : int or tuple of int or list of int The shape of the empty array. ctx : Context, optional An optional device context. Defaults to the current default context (``mxnet.context.current_context()``). dtype : str or numpy.dtype, optional An optional value type (default is `float32`). out : NDArray, optional The output NDArray (default is `None`). Returns ------- NDArray A new array of the specified shape filled with all ones. Examples -------- >>> mx.nd.ones(1).asnumpy() array([ 1.], dtype=float32) >>> mx.nd.ones((1,2), mx.gpu(0)) >>> mx.nd.ones((1,2), dtype='float16').asnumpy() array([[ 1., 1.]], dtype=float16) RTRURRN(RmRR Rt_ones(RTRURRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRc s  cC`s/|dkrt|||ƒn|}||(|S(s{Returns a new array of given shape and type, filled with the given value `val`. Parameters -------- shape : int or tuple of int The shape of the new array. val : scalar Fill value. ctx : Context, optional Device context (default is the current default context). dtype : `str` or `numpy.dtype`, optional The data type of the returned `NDArray`. The default datatype is `float32`. out : NDArray, optional The output NDArray (default is `None`). Returns ------- NDArray `NDArray` filled with `val`, with the given shape, ctx, and dtype. Examples -------- >>> mx.nd.full(1, 2.0).asnumpy() array([ 2.], dtype=float32) >>> mx.nd.full((1, 2), 2.0, mx.gpu(0)) >>> mx.nd.full((1, 2), 2.0, dtype='float16').asnumpy() array([[ 2., 2.]], dtype=float16) N(RmR„(RTRíRURRRt((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR$‰ s$cC`s©t|tƒr-|dkr$|jn|}n\|dkr?tn|}t|tjƒs‰ytj|d|ƒ}Wq‰tdƒ‚q‰Xnt |j ||ƒ}||(|S(sŒCreates an array from any object exposing the array interface. Parameters ---------- source_array : array_like An object exposing the array interface, an object whose `__array__` method returns an array, or any (nested) sequence. ctx : Context, optional Device context (default is the current default context). dtype : str or numpy.dtype, optional The data type of the output array. The default dtype is ``source_array.dtype`` if `source_array` is an `NDArray`, `float32` otherwise. Returns ------- NDArray An `NDArray` with the same contents as the `source_array`. RRs&source_array must be array like objectN( RwRRmRRR RQRÄRR{R„RT(RRURRtarr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR¬ scC`s+ytjjj||jƒ}Wn!tk rBtd|ƒ‚nXytjjj||jƒ}Wn+tk rtd|jd|ƒ‚nXt|ƒt|ƒkr·tdƒ‚ngt|jƒD]}||krÇ|^qÇ}x3t t ||ƒƒD]\}}|j ||ƒqûWt j ||ƒS(sMoves the `source` axis into the `destination` position while leaving the other axes in their original order Parameters ---------- tensor : mx.nd.array The array which axes should be reordered source : int or sequence of int Original position of the axes to move. Can be negative but must be unique. destination : int or sequence of int Destination position for each of the original axes. Can be negative but must be unique. Returns ------- result : mx.nd.array Array with moved axes. Examples -------- >>> X = mx.nd.array([[1, 2, 3], [4, 5, 6]]) >>> mx.nd.moveaxis(X, 0, 1).shape (3L, 2L) >>> X = mx.nd.zeros((3, 4, 5)) >>> mx.nd.moveaxis(X, [0, 1], [-1, -2]).shape (5, 4, 3) s4Source should verify 0 <= source < tensor.ndimGot %ds>Destination should verify 0 <= destination < tensor.ndim (%d).sGot %dsJ`source` and `destination` arguments must have the same number of elements(RQtcoretnumerictnormalize_axis_tupleRuRÐRvRLRÒtsortedR­tinsertRR:(ttensortsourcet destinationtnR tdesttsrc((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR/Í s   ."gð?cC`sq|d k rtjdtƒn|d kr7tƒ}ntjd|d|d|d|dtd|dt|ƒƒS( ssReturns evenly spaced values within a given interval. Values are generated within the half-open interval [`start`, `stop`). In other words, the interval includes `start` but excludes `stop`. The function is similar to the built-in Python function `range` and to `numpy.arange`, but returns an `NDArray`. Parameters ---------- start : number, optional Start of interval. The default start value is 0. stop : number End of interval. step : number, optional Spacing between values. The default step size is 1. repeat : int, optional Number of times to repeat each element. The default repeat count is 1. infer_range : boolean, optional When set to True, infer the stop position from the start, step, repeat, and output tensor size. ctx : Context, optional Device context. Default context is the current default context. dtype : str or numpy.dtype, optional The data type of the `NDArray`. The default datatype is `np.float32`. Returns ------- NDArray `NDArray` of evenly spaced values in the specified range. Examples -------- >>> mx.nd.arange(3).asnumpy() array([ 0., 1., 2.], dtype=float32) >>> mx.nd.arange(2, 6).asnumpy() array([ 2., 3., 4., 5.], dtype=float32) >>> mx.nd.arange(2, 6, step=2).asnumpy() array([ 2., 4.], dtype=float32) >>> mx.nd.arange(2, 6, step=1.5, repeat=2).asnumpy() array([ 2. , 2. , 3.5, 3.5, 5. , 5. ], dtype=float32) >>> mx.nd.arange(2, 6, step=2, repeat=3, dtype='int32').asnumpy() array([2, 2, 2, 4, 4, 4], dtype=int32) s*`infer_range` argument has been deprecatedRÌRÍRÎR#t infer_rangeRRRUN( RmR‰RŠtDeprecationWarningRRt_arangeR¢Rf(RÌRÍRÎR#RÂRURR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR s,     !cC`sL|dkrtƒ}ntjd|d|d|d|d|dt|ƒƒS(sŽReturn evenly spaced numbers within a specified interval. Values are generated within the half-open interval [`start`, `stop`) or closed interval [start, stop] depending on whether `endpoint` is True or False. The function is similar to `numpy.linspace`, but returns an `NDArray`. Parameters ---------- start : number Start of interval. stop : number End of interval, unless endpoint is set to False. In that case, the sequence consists of all but the last of `num + 1` evenly spaced samples, so that stop is excluded. Note that the step size changes when endpoint is False. num : number Number of samples to generate. Must be non-negative. endpoint : bool If True, stop is the last sample. Otherwise, it is not included. The default is True. ctx : Context, optional Device context. Default context is the current default context. dtype : str or numpy.dtype, optional The data type of the `NDArray`. The default datatype is `np.float32`. Returns ------- NDArray `NDArray` of evenly spaced values in the specified range. Examples -------- >>> mx.nd.linspace(2.0, 3.0, 5).asnumpy() array([ 2., 2.25., 2.5, 2.75, 3.], dtype=float32) >>> mx.nd.linspace(2.0, 3.0, 5, endpoint=False).asnumpy() array([ 2., 2.2., 2.4, 2.6, 2.8], dtype=float32) RÌRÍtnumtendpointRRRUN(RmRRt _linspaceRf(RÌRÍRÅRÆRURR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR 8 s&  cC`s¾t|tƒr`t|tƒr+|||ƒS|dkrJ||t|ƒƒS||t|ƒƒSnZt|tƒr‚||t|ƒƒSt|tƒrž|||ƒStdtt|ƒƒƒ‚dS(sg Helper function for element-wise operation. The function will perform numpy-like broadcasting if needed and call different functions. Parameters -------- lhs : NDArray or numeric value Left-hand side operand. rhs : NDArray or numeric value Right-hand operand, fn_array : function Function to be called if both lhs and rhs are of ``NDArray`` type. fn_scalar : function Function to be called if both lhs and rhs are numeric values. lfn_scalar : function Function to be called if lhs is ``NDArray`` while rhs is numeric value rfn_scalar : function Function to be called if lhs is numeric value while rhs is ``NDArray``; if none is provided, then the function is commutative, so rfn_scalar is equal to lfn_scalar Returns -------- NDArray result array stype %s not supportedN(RwRRmRzRR{RfRS(RRtfn_arrayt fn_scalart lfn_scalart rfn_scalar((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt _ufunc_helperf s   cC`s"t||tjtjtjdƒS(s¸Returns element-wise sum of the input arrays with broadcasting. Equivalent to ``lhs + rhs``, ``mx.nd.broadcast_add(lhs, rhs)`` and ``mx.nd.broadcast_plus(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape Parameters ---------- lhs : scalar or mxnet.ndarray.array First array to be added. rhs : scalar or mxnet.ndarray.array Second array to be added. If ``lhs.shape != rhs.shape``, they must be broadcastable to a common shape. Returns ------- NDArray The element-wise sum of the input arrays. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = mx.nd.arange(2).reshape((2,1)) >>> z = mx.nd.arange(2).reshape((1,2)) >>> x.asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> y.asnumpy() array([[ 0.], [ 1.]], dtype=float32) >>> z.asnumpy() array([[ 0., 1.]], dtype=float32) >>> (x+2).asnumpy() array([[ 3., 3., 3.], [ 3., 3., 3.]], dtype=float32) >>> (x+y).asnumpy() array([[ 1., 1., 1.], [ 2., 2., 2.]], dtype=float32) >>> mx.nd.add(x,y).asnumpy() array([[ 1., 1., 1.], [ 2., 2., 2.]], dtype=float32) >>> (z + y).asnumpy() array([[ 0., 1.], [ 1., 2.]], dtype=float32) N(RÌRRxR RRRyRm(RR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR– s4cC`s%t||tjtjtjtjƒS(sÕReturns element-wise difference of the input arrays with broadcasting. Equivalent to ``lhs - rhs``, ``mx.nd.broadcast_sub(lhs, rhs)`` and ``mx.nd.broadcast_minus(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. Parameters ---------- lhs : scalar or mxnet.ndarray.array First array to be subtracted. rhs : scalar or mxnet.ndarray.array Second array to be subtracted. If ``lhs.shape != rhs.shape``, they must be broadcastable to a common shape. Returns ------- NDArray The element-wise difference of the input arrays. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = mx.nd.arange(2).reshape((2,1)) >>> z = mx.nd.arange(2).reshape((1,2)) >>> x.asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> y.asnumpy() array([[ 0.], [ 1.]], dtype=float32) >>> z.asnumpy() array([[ 0., 1.]], dtype=float32) >>> (x-2).asnumpy() array([[-1., -1., -1.], [-1., -1., -1.]], dtype=float32) >>> (x-y).asnumpy() array([[ 1., 1., 1.], [ 0., 0., 0.]], dtype=float32) >>> mx.nd.subtract(x,y).asnumpy() array([[ 1., 1., 1.], [ 0., 0., 0.]], dtype=float32) >>> (z-y).asnumpy() array([[ 0., 1.], [-1., 0.]], dtype=float32) (RÌRRR tsubRR€t_rminus_scalar(RR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR5Ô s4cC`s"t||tjtjtjdƒS(s®Returns element-wise product of the input arrays with broadcasting. Equivalent to ``lhs * rhs`` and ``mx.nd.broadcast_mul(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. Parameters ---------- lhs : scalar or mxnet.ndarray.array First array to be multiplied. rhs : scalar or mxnet.ndarray.array Second array to be multiplied. If ``lhs.shape != rhs.shape``, they must be broadcastable to a common shape. Returns ------- NDArray The element-wise multiplication of the input arrays. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = mx.nd.arange(2).reshape((2,1)) >>> z = mx.nd.arange(2).reshape((1,2)) >>> x.asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> y.asnumpy() array([[ 0.], [ 1.]], dtype=float32) >>> z.asnumpy() array([[ 0., 1.]], dtype=float32) >>> (x*2).asnumpy() array([[ 2., 2., 2.], [ 2., 2., 2.]], dtype=float32) >>> (x*y).asnumpy() array([[ 0., 0., 0.], [ 1., 1., 1.]], dtype=float32) >>> mx.nd.multiply(x, y).asnumpy() array([[ 0., 0., 0.], [ 1., 1., 1.]], dtype=float32) >>> (z*y).asnumpy() array([[ 0., 0.], [ 0., 1.]], dtype=float32) N(RÌRR†R R¡RR„Rm(RR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR1 s3cC`s%t||tjtjtjtjƒS(sReturns element-wise division of the input arrays with broadcasting. Equivalent to ``lhs / rhs`` and ``mx.nd.broadcast_div(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. Parameters ---------- lhs : scalar or mxnet.ndarray.array First array in division. rhs : scalar or mxnet.ndarray.array Second array in division. The arrays to be divided. If ``lhs.shape != rhs.shape``, they must be broadcastable to a common shape. Returns ------- NDArray The element-wise division of the input arrays. Examples -------- >>> x = mx.nd.ones((2,3))*6 >>> y = mx.nd.ones((2,1))*2 >>> x.asnumpy() array([[ 6., 6., 6.], [ 6., 6., 6.]], dtype=float32) >>> y.asnumpy() array([[ 2.], [ 2.]], dtype=float32) >>> x/2 >>> (x/3).asnumpy() array([[ 2., 2., 2.], [ 2., 2., 2.]], dtype=float32) >>> (x/y).asnumpy() array([[ 3., 3., 3.], [ 3., 3., 3.]], dtype=float32) >>> mx.nd.divide(x,y).asnumpy() array([[ 3., 3., 3.], [ 3., 3., 3.]], dtype=float32) (RÌRR‹R ttruedivRRŒt _rdiv_scalar(RR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR"O s/cC`s%t||tjtjtjtjƒS(sReturns element-wise modulo of the input arrays with broadcasting. Equivalent to ``lhs % rhs`` and ``mx.nd.broadcast_mod(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. Parameters ---------- lhs : scalar or mxnet.ndarray.array First array in modulo. rhs : scalar or mxnet.ndarray.array Second array in modulo. The arrays to be taken modulo. If ``lhs.shape != rhs.shape``, they must be broadcastable to a common shape. Returns ------- NDArray The element-wise modulo of the input arrays. Examples -------- >>> x = mx.nd.ones((2,3))*6 >>> y = mx.nd.ones((2,1))*4 >>> x.asnumpy() array([[ 6., 6., 6.], [ 6., 6., 6.]], dtype=float32) >>> y.asnumpy() array([[ 4.], [ 4.]], dtype=float32) >>> x%5 >>> (x%5).asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> (x%y).asnumpy() array([[ 2., 2., 2.], [ 2., 2., 2.]], dtype=float32) >>> mx.nd.modulo(x,y).asnumpy() array([[ 2., 2., 2.], [ 2., 2., 2.]], dtype=float32) (RÌRR“R tmodRR”t _rmod_scalar(RR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR0ˆ s/cC`s%t||tjtjtjtjƒS(s§Returns result of first array elements raised to powers from second array, element-wise with broadcasting. Equivalent to ``base ** exp`` and ``mx.nd.broadcast_power(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. Parameters ---------- base : scalar or NDArray The base array exp : scalar or NDArray The exponent array. If ``base.shape != exp.shape``, they must be broadcastable to a common shape. Returns -------- NDArray The bases in x raised to the exponents in y. Examples -------- >>> x = mx.nd.ones((2,3))*2 >>> y = mx.nd.arange(1,3).reshape((2,1)) >>> z = mx.nd.arange(1,3).reshape((2,1)) >>> x.asnumpy() array([[ 2., 2., 2.], [ 2., 2., 2.]], dtype=float32) >>> y.asnumpy() array([[ 1.], [ 2.]], dtype=float32) >>> z.asnumpy() array([[ 1.], [ 2.]], dtype=float32) >>> (x**2).asnumpy() array([[ 4., 4., 4.], [ 4., 4., 4.]], dtype=float32) >>> (x**y).asnumpy() array([[ 2., 2., 2.], [ 4., 4., 4.]], dtype=float32) >>> mx.nd.power(x,y).asnumpy() array([[ 2., 2., 2.], [ 4., 4., 4.]], dtype=float32) >>> (z**y).asnumpy() array([[ 1.], [ 4.]], dtype=float32) (RÌRtbroadcast_powerR tpowRt _power_scalart_rpower_scalar(tbaseRZ((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR4Á s4cC`s"t||tjd„tjdƒS(sHReturns element-wise maximum of the input arrays with broadcasting. Equivalent to ``mx.nd.broadcast_maximum(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. Parameters ---------- lhs : scalar or mxnet.ndarray.array First array to be compared. rhs : scalar or mxnet.ndarray.array Second array to be compared. If ``lhs.shape != rhs.shape``, they must be broadcastable to a common shape. Returns ------- NDArray The element-wise maximum of the input arrays. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = mx.nd.arange(2).reshape((2,1)) >>> z = mx.nd.arange(2).reshape((1,2)) >>> x.asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> y.asnumpy() array([[ 0.], [ 1.]], dtype=float32) >>> z.asnumpy() array([[ 0., 1.]], dtype=float32) >>> mx.nd.maximum(x, 2).asnumpy() array([[ 2., 2., 2.], [ 2., 2., 2.]], dtype=float32) >>> mx.nd.maximum(x, y).asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> mx.nd.maximum(y, z).asnumpy() array([[ 0., 1.], [ 1., 1.]], dtype=float32) cS`s||kr|S|S(N((Rdty((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt2 RN(RÌRtbroadcast_maximumRt_maximum_scalarRm(RR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR-ÿ s/cC`s"t||tjd„tjdƒS(sHReturns element-wise minimum of the input arrays with broadcasting. Equivalent to ``mx.nd.broadcast_minimum(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. Parameters ---------- lhs : scalar or mxnet.ndarray.array First array to be compared. rhs : scalar or mxnet.ndarray.array Second array to be compared. If ``lhs.shape != rhs.shape``, they must be broadcastable to a common shape. Returns ------- NDArray The element-wise minimum of the input arrays. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = mx.nd.arange(2).reshape((2,1)) >>> z = mx.nd.arange(2).reshape((1,2)) >>> x.asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> y.asnumpy() array([[ 0.], [ 1.]], dtype=float32) >>> z.asnumpy() array([[ 0., 1.]], dtype=float32) >>> mx.nd.minimum(x, 2).asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> mx.nd.minimum(x, y).asnumpy() array([[ 0., 0., 0.], [ 1., 1., 1.]], dtype=float32) >>> mx.nd.minimum(z, y).asnumpy() array([[ 0., 0.], [ 0., 1.]], dtype=float32) cS`s||kr|S|S(N((RdRØ((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRÙk RN(RÌRtbroadcast_minimumRt_minimum_scalarRm(RR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR.8 s/cC`s"t||tjd„tjdƒS(s+Returns the result of element-wise **equal to** (==) comparison operation with broadcasting. For each element in input arrays, return 1(true) if corresponding elements are same, otherwise return 0(false). Equivalent to ``lhs == rhs`` and ``mx.nd.broadcast_equal(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. Parameters ---------- lhs : scalar or mxnet.ndarray.array First array to be compared. rhs : scalar or mxnet.ndarray.array Second array to be compared. If ``lhs.shape != rhs.shape``, they must be broadcastable to a common shape. Returns ------- NDArray Output array of boolean values. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = mx.nd.arange(2).reshape((2,1)) >>> z = mx.nd.arange(2).reshape((1,2)) >>> x.asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> y.asnumpy() array([[ 0.], [ 1.]], dtype=float32) >>> z.asnumpy() array([[ 0., 1.]], dtype=float32) >>> (x == 1).asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> (x == y).asnumpy() array([[ 0., 0., 0.], [ 1., 1., 1.]], dtype=float32) >>> mx.nd.equal(x,y).asnumpy() array([[ 0., 0., 0.], [ 1., 1., 1.]], dtype=float32) >>> (z == y).asnumpy() array([[ 1., 0.], [ 0., 1.]], dtype=float32) cS`s||krdSdS(Nii((RdRØ((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRÙ« RN(RÌRtbroadcast_equalRt _equal_scalarRm(RR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR#q s6cC`s"t||tjd„tjdƒS(s–Returns the result of element-wise **not equal to** (!=) comparison operation with broadcasting. For each element in input arrays, return 1(true) if corresponding elements are different, otherwise return 0(false). Equivalent to ``lhs != rhs`` and ``mx.nd.broadcast_not_equal(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. Parameters ---------- lhs : scalar or mxnet.ndarray.array First array to be compared. rhs : scalar or mxnet.ndarray.array Second array to be compared. If ``lhs.shape != rhs.shape``, they must be broadcastable to a common shape. Returns ------- NDArray Output array of boolean values. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = mx.nd.arange(2).reshape((2,1)) >>> z = mx.nd.arange(2).reshape((1,2)) >>> x.asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> y.asnumpy() array([[ 0.], [ 1.]], dtype=float32) >>> z.asnumpy() array([[ 0., 1.]], dtype=float32) >>> (z == y).asnumpy() array([[ 1., 0.], [ 0., 1.]], dtype=float32) >>> (x != 1).asnumpy() array([[ 0., 0., 0.], [ 0., 0., 0.]], dtype=float32) >>> (x != y).asnumpy() array([[ 1., 1., 1.], [ 0., 0., 0.]], dtype=float32) >>> mx.nd.not_equal(x, y).asnumpy() array([[ 1., 1., 1.], [ 0., 0., 0.]], dtype=float32) >>> (z != y).asnumpy() array([[ 0., 1.], [ 1., 0.]], dtype=float32) cS`s||krdSdS(Nii((RdRØ((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRÙî RN(RÌRtbroadcast_not_equalRt_not_equal_scalarRm(RR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR2± s9cC`s%t||tjd„tjtjƒS(s1Returns the result of element-wise **greater than** (>) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are greater than rhs, otherwise return 0(false). Equivalent to ``lhs > rhs`` and ``mx.nd.broadcast_greater(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. Parameters ---------- lhs : scalar or mxnet.ndarray.array First array to be compared. rhs : scalar or mxnet.ndarray.array Second array to be compared. If ``lhs.shape != rhs.shape``, they must be broadcastable to a common shape. Returns ------- NDArray Output array of boolean values. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = mx.nd.arange(2).reshape((2,1)) >>> z = mx.nd.arange(2).reshape((1,2)) >>> x.asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> y.asnumpy() array([[ 0.], [ 1.]], dtype=float32) >>> z.asnumpy() array([[ 0., 1.]], dtype=float32) >>> (x > 1).asnumpy() array([[ 0., 0., 0.], [ 0., 0., 0.]], dtype=float32) >>> (x > y).asnumpy() array([[ 1., 1., 1.], [ 0., 0., 0.]], dtype=float32) >>> mx.nd.greater(x, y).asnumpy() array([[ 1., 1., 1.], [ 0., 0., 0.]], dtype=float32) >>> (z > y).asnumpy() array([[ 0., 1.], [ 0., 0.]], dtype=float32) cS`s||krdSdS(Nii((RdRØ((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRÙ. R(RÌRtbroadcast_greaterRt_greater_scalart_lesser_scalar(RR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR%ô s6cC`s%t||tjd„tjtjƒS(sWReturns the result of element-wise **greater than or equal to** (>=) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are greater than equal to rhs, otherwise return 0(false). Equivalent to ``lhs >= rhs`` and ``mx.nd.broadcast_greater_equal(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. Parameters ---------- lhs : scalar or mxnet.ndarray.array First array to be compared. rhs : scalar or mxnet.ndarray.array Second array to be compared. If ``lhs.shape != rhs.shape``, they must be broadcastable to a common shape. Returns ------- NDArray Output array of boolean values. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = mx.nd.arange(2).reshape((2,1)) >>> z = mx.nd.arange(2).reshape((1,2)) >>> x.asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> y.asnumpy() array([[ 0.], [ 1.]], dtype=float32) >>> z.asnumpy() array([[ 0., 1.]], dtype=float32) >>> (x >= 1).asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> (x >= y).asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> mx.nd.greater_equal(x, y).asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> (z >= y).asnumpy() array([[ 1., 1.], [ 0., 1.]], dtype=float32) cS`s||krdSdS(Nii((RdRØ((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRÙn R(RÌRtbroadcast_greater_equalRt_greater_equal_scalart_lesser_equal_scalar(RR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR&4 s6cC`s%t||tjd„tjtjƒS(s+Returns the result of element-wise **lesser than** (<) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are less than rhs, otherwise return 0(false). Equivalent to ``lhs < rhs`` and ``mx.nd.broadcast_lesser(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. Parameters ---------- lhs : scalar or mxnet.ndarray.array First array to be compared. rhs : scalar or mxnet.ndarray.array Second array to be compared. If ``lhs.shape != rhs.shape``, they must be broadcastable to a common shape. Returns ------- NDArray Output array of boolean values. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = mx.nd.arange(2).reshape((2,1)) >>> z = mx.nd.arange(2).reshape((1,2)) >>> x.asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> y.asnumpy() array([[ 0.], [ 1.]], dtype=float32) >>> z.asnumpy() array([[ 0., 1.]], dtype=float32) >>> (x < 1).asnumpy() array([[ 0., 0., 0.], [ 0., 0., 0.]], dtype=float32) >>> (x < y).asnumpy() array([[ 0., 0., 0.], [ 0., 0., 0.]], dtype=float32) >>> mx.nd.lesser(x, y).asnumpy() array([[ 0., 0., 0.], [ 0., 0., 0.]], dtype=float32) >>> (z < y).asnumpy() array([[ 0., 0.], [ 1., 0.]], dtype=float32) cS`s||krdSdS(Nii((RdRØ((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRÙ® R(RÌRtbroadcast_lesserRRäRã(RR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR(t s6cC`s%t||tjd„tjtjƒS(sSReturns the result of element-wise **lesser than or equal to** (<=) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are lesser than equal to rhs, otherwise return 0(false). Equivalent to ``lhs <= rhs`` and ``mx.nd.broadcast_lesser_equal(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. Parameters ---------- lhs : scalar or mxnet.ndarray.array First array to be compared. rhs : scalar or mxnet.ndarray.array Second array to be compared. If ``lhs.shape != rhs.shape``, they must be broadcastable to a common shape. Returns ------- NDArray Output array of boolean values. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = mx.nd.arange(2).reshape((2,1)) >>> z = mx.nd.arange(2).reshape((1,2)) >>> x.asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> y.asnumpy() array([[ 0.], [ 1.]], dtype=float32) >>> z.asnumpy() array([[ 0., 1.]], dtype=float32) >>> (x <= 1).asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> (x <= y).asnumpy() array([[ 0., 0., 0.], [ 1., 1., 1.]], dtype=float32) >>> mx.nd.lesser_equal(x, y).asnumpy() array([[ 0., 0., 0.], [ 1., 1., 1.]], dtype=float32) >>> (z <= y).asnumpy() array([[ 1., 0.], [ 1., 1.]], dtype=float32) cS`s||krdSdS(Nii((RdRØ((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRÙî R(RÌRtbroadcast_lesser_equalRRçRæ(RR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR)´ s6cC`s"t||tjd„tjdƒS(sûReturns the result of element-wise **logical and** comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements and rhs elements are true, otherwise return 0(false). Equivalent to ``lhs and rhs`` and ``mx.nd.broadcast_logical_and(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. Parameters ---------- lhs : scalar or mxnet.ndarray.array First input of the function. rhs : scalar or mxnet.ndarray.array Second input of the function. If ``lhs.shape != rhs.shape``, they must be broadcastable to a common shape. Returns ------- NDArray Output array of boolean values. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = mx.nd.arange(2).reshape((2,1)) >>> z = mx.nd.arange(2).reshape((1,2)) >>> x.asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> y.asnumpy() array([[ 0.], [ 1.]], dtype=float32) >>> z.asnumpy() array([[ 0., 1.]], dtype=float32) >>> mx.nd.logical_and(x, 1).asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> mx.nd.logical_and(x, y).asnumpy() array([[ 0., 0., 0.], [ 1., 1., 1.]], dtype=float32) >>> mx.nd.logical_and(z, y).asnumpy() array([[ 0., 0.], [ 0., 1.]], dtype=float32) cS`s|r|rdSdS(Nii((RdRØ((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRÙ*RN(RÌRtbroadcast_logical_andRt_logical_and_scalarRm(RR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR*ó s3cC`s"t||tjd„tjdƒS(sôReturns the result of element-wise **logical or** comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements or rhs elements are true, otherwise return 0(false). Equivalent to ``lhs or rhs`` and ``mx.nd.broadcast_logical_or(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. Parameters ---------- lhs : scalar or mxnet.ndarray.array First input of the function. rhs : scalar or mxnet.ndarray.array Second input of the function. If ``lhs.shape != rhs.shape``, they must be broadcastable to a common shape. Returns ------- NDArray Output array of boolean values. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = mx.nd.arange(2).reshape((2,1)) >>> z = mx.nd.arange(2).reshape((1,2)) >>> x.asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> y.asnumpy() array([[ 0.], [ 1.]], dtype=float32) >>> z.asnumpy() array([[ 0., 1.]], dtype=float32) >>> mx.nd.logical_or(x, 1).asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> mx.nd.logical_or(x, y).asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> mx.nd.logical_or(z, y).asnumpy() array([[ 0., 1.], [ 1., 1.]], dtype=float32) cS`s|s |rdSdS(Nii((RdRØ((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRÙfRN(RÌRtbroadcast_logical_orRt_logical_or_scalarRm(RR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR+/s3cC`s"t||tjd„tjdƒS(s*Returns the result of element-wise **logical xor** comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements or rhs elements are true, otherwise return 0(false). Equivalent to ``bool(lhs) ^ bool(rhs)`` and ``mx.nd.broadcast_logical_xor(lhs, rhs)``. .. note:: If the corresponding dimensions of two arrays have the same size or one of them has size 1, then the arrays are broadcastable to a common shape. Parameters ---------- lhs : scalar or mxnet.ndarray.array First input of the function. rhs : scalar or mxnet.ndarray.array Second input of the function. If ``lhs.shape != rhs.shape``, they must be broadcastable to a common shape. Returns ------- NDArray Output array of boolean values. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = mx.nd.arange(2).reshape((2,1)) >>> z = mx.nd.arange(2).reshape((1,2)) >>> x.asnumpy() array([[ 1., 1., 1.], [ 1., 1., 1.]], dtype=float32) >>> y.asnumpy() array([[ 0.], [ 1.]], dtype=float32) >>> z.asnumpy() array([[ 0., 1.]], dtype=float32) >>> mx.nd.logical_xor(x, y).asnumpy() array([[ 1., 1., 1.], [ 0., 0., 0.]], dtype=float32) cS`st|ƒt|ƒArdSdS(Nii(R£(RdRØ((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRÙœRN(RÌRtbroadcast_logical_xorRt_logical_xor_scalarRm(RR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR,ks-cC`s t||ƒS(s0This function is similar to :meth:`divide`. (R"(RR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR6¡sc C`st|tƒst‚t|ƒdks-t‚t|dtƒsFt‚| rgt|ƒdkrg|dS|dj|}|djd|!}|dj|d}|dj}xq|dD]e}||j|7}||jd|!ksìt‚||j|dks t‚||jks¹t‚q¹W||f|}t|d|djd|ƒ} d} g|D] } d^q_} t|ƒ} x“|D]‹}|dkr±|| | | |jd+nM| | |<| |j|| |>> mx.nd.zeros(1).asnumpy() array([ 0.], dtype=float32) >>> mx.nd.zeros((1,2), mx.gpu(0)) >>> mx.nd.zeros((1,2), mx.gpu(0), 'float16').asnumpy() array([[ 0., 0.]], dtype=float16) RTRURRN(RmRR RR“(RTRURRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRŽ s  c K`s[|dkrtƒ}n|dkr*tn|}tjd|d|d|d|d||S(syReturn a 2-D array with ones on the diagonal and zeros elsewhere. Parameters ---------- N: int Number of rows in the output. M: int, optional Number of columns in the output. If 0, defaults to N. k: int, optional Index of the diagonal: 0 (the default) refers to the main diagonal, a positive value refers to an upper diagonal, and a negative value to a lower diagonal. ctx: Context, optional An optional device context (default is the current default context) dtype: str or numpy.dtype, optional An optional value type (default is `float32`) Returns ------- NDArray A created array Examples -------- >>> mx.nd.eye(2) [[ 1. 0.] [ 0. 1.]] >>> mx.nd.eye(2, 3, 1) [[ 0. 1. 0.] [ 0. 0. 1.]] tNtMRçRURRN(RmRR Rt_eye(RüRýRçRURRR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR!0s#  cC`sdt|tƒr|f}n|dkr3tƒ}n|dkrHt}ntdt||t|ƒƒS(s¼Returns a new array of given shape and type, without initializing entries. Parameters ---------- shape : int or tuple of int The shape of the empty array. ctx : Context, optional An optional device context (default is the current default context). dtype : str or numpy.dtype, optional An optional value type (default is `float32`). Returns ------- NDArray A created array. R_N(RwRPRmRR RRWR¢(RTRURR((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR„[s     i cC`s°t|tƒr%tjd|d|ƒSt|tƒr |dkr„tjdƒtj |j ƒd|ƒ\}}t |ƒt |ƒfStjd|d|d|ƒSt dƒ‚dS(suCompute the histogram of the input data. Parameters ---------- a : NDArray Input data. The histogram is computed over the flattened array. bins : int or sequence of scalars If bins is an int, it defines the number of equal-width bins in the given range (10, by default). If bins is a sequence, it defines the bin edges, including the rightmost edge, allowing for non-uniform bin widths. range : (float, float), optional The lower and upper range of the bins. If not provided, range is simply (a.min(), a.max()). Values outside the range are ignored. The first element of the range must be less than or equal to the second. range affects the automatic bin computation as well, the range will be equally divided by the number of bins. Returns ------- NDArray A created array. R†tbinssMrange is not specified, using numpy's result to ensure consistency with numpytbin_cntRÒs7bins argument should be either an integer or an NDArrayN( RwRRt _histogramRRmR‰RŠRQR9RgRRv(R²RÿRÒRˆt bin_bounds((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR9ws  !c C`s¾g}|j|}t|tƒrw|}||rAtdƒ‚nt||ƒ}gt|ƒD]}||^q^}n1t|tƒrœdgt|ƒ}n tdƒ‚tj||||ƒS(s/Split an array into multiple sub-arrays. Parameters ---------- ary : NDArray Array to be divided into sub-arrays. indices_or_sections : int or tuple of ints If `indices_or_sections` is an integer, N, the array will be divided into N equal arrays along `axis`. If such a split is not possible, an error is raised. If `indices_or_sections` is a 1-D array of sorted integers, the entries indicate where along `axis` the array is split. For example, ``[2, 3]`` would, for ``axis=0``, result in - ary[:2] - ary[2:3] - ary[3:] If an index exceeds the dimension of the array along `axis`, an empty sub-array is returned correspondingly. axis : int, optional The axis along which to split, default is 0. squeeze_axis: boolean, optional Whether to squeeze the axis of sub-arrays or not, only useful when size of the sub-arrays are 1 on the `axis`. Default is False. Returns ------- NDArray A created array. s0array split does not result in an equal divisionis4indices_or_sections must either int or tuple of ints( RTRwRPRvRÒRÆRÅRt _split_v2( tarytindices_or_sectionsR t squeeze_axisR×t axis_sizetsectionst section_sizeRÜ((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR:œs  & tdltensort used_dltensorcC`s\tj|ƒ}tjj|tƒrXtjtjj|tƒƒ}ttj|ƒƒndS(N( RFRt pythonapitPyCapsule_IsValidt_c_str_dltensortPyCapsule_GetPointerRRtMXNDArrayCallDLPackDeleter(t pycapsuleR³((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt_dlpack_deleterÍs cC`sK|jƒtƒ}ttj|jtj|ƒƒƒtjj |t t ƒS(s]Returns a reference view of NDArray that represents as DLManagedTensor until all previous write operations on the current array are finished. Parameters ---------- data: NDArray input data. Returns ------- PyCapsule (the pointer of DLManagedTensor) a reference view of NDArray that represents as DLManagedTensor. Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = mx.nd.to_dlpack_for_read(x) >>> type(y) >>> z = mx.nd.from_dlpack(y) >>> z [[1. 1. 1.] [1. 1. 1.]] ( RtRRRtMXNDArrayToDLPackR_RFRGR t PyCapsule_NewRt_c_dlpack_deleter(R†tdlpack((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR;Ös  "cC`sWttj|jƒƒtƒ}ttj|jtj|ƒƒƒtjj |t t ƒS(srReturns a reference view of NDArray that represents as DLManagedTensor until all previous read/write operations on the current array are finished. Parameters ---------- data: NDArray input data. Returns ------- PyCapsule (the pointer of DLManagedTensor) a reference view of NDArray that represents as DLManagedTensor. Examples -------- >>> x = mx.nd.ones((2,3)) >>> w = mx.nd.to_dlpack_for_write(x) >>> type(w) >>> u = mx.nd.from_dlpack(w) >>> u += 1 >>> x [[2. 2. 2.] [2. 2. 2.]] ( RRtMXNDArrayWaitToWriteR_RRRFRGR RRR(R†R((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR<õs "cC`s²tƒ}tj|ƒ}tjj|tƒs?ttdƒƒ‚tjtjj |tƒƒ}t t j |t tj|ƒƒƒtjj|tƒtjj|dƒtd|ƒS(sãReturns a NDArray backed by a dlpack tensor. Parameters ---------- dlpack: PyCapsule (the pointer of DLManagedTensor) input data Returns ------- NDArray a NDArray backed by a dlpack tensor Examples -------- >>> x = mx.nd.ones((2,3)) >>> y = mx.nd.to_dlpack_for_read(x) >>> type(y) >>> z = mx.nd.from_dlpack(y) >>> type(z) >>> z [[ 1. 1. 1.] [ 1. 1. 1.]] >>> w = mx.nd.to_dlpack_for_write(x) >>> type(w) >>> u = mx.nd.from_dlpack(w) >>> u += 1 >>> x [[2. 2. 2.] [2. 2. 2.]] sCInvalid DLPack Tensor. DLTensor capsules can be consumed only once.R_N(RRFt py_objectR R RRÇRvRRRRtMXNDArrayFromDLPackExR¢RGtPyCapsule_SetNamet_c_str_used_dltensortPyCapsule_SetDestructorRmR(RR_t dlpack_handle((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR=s%  "t DLContextcB`s&eZdejfdejfgZRS(t device_typeRO(RiR¢RFRMt_fields_(((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyRFs t DLDataTypecB`sieZdejfdejfdejfgZidd6dd6dd 6dd 6dd 6dd 6dd6ZRS(t type_codetbitstlanesii iRÃi@tint64R£tuint32tuint64itfloat32tfloat64(ii i(ii@i(iii(ii i(ii@i(ii i(ii@i(RiR¢RFtc_uint8tc_uint16R tTYPE_MAP(((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR!Ks  tDLTensorcB`sneZdejfdefdejfdefdejejƒfdejejƒfdej fgZ RS(R†RURuRRRTtstridest byte_offset( RiR¢RFRRRMR!R©Rtc_uint64R (((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR-Zs    tDLManagedTensorcB`seZRS((RiR¢(((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR1cst dl_tensort manager_ctxtdeletercC`s5|jj}tj|tjƒ}tjj|ƒdS(N(tcontentsR3RFtcastRR t Py_DecRef(tdl_managed_tensor_handletvoid_ptpyobj((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pytdl_managed_tensor_deleteros c`s³d„‰d„‰‡‡fd†}|s=t|d|jƒS|jdsYtdƒ‚nt|jd<||ƒ}tƒ}ttjt j |ƒt t j |ƒƒƒt d|ƒS( sÔReturns an MXNet's ndarray backed by numpy's ndarray. When `zero_copy` is set to be true, this API consumes numpy's ndarray and produces MXNet's ndarray without having to copy the content. In this case, we disallow users to modify the given numpy ndarray, and it is suggested not to read the numpy ndarray as well for internal correctness. Parameters ---------- ndarray: numpy.ndarray input data zero_copy: bool Whether we use DLPack's zero-copy conversion to convert to MXNet's NDArray. This is only available for c-contiguous arrays, i.e. array.flags[C_CONTIGUOUS] == True. Returns ------- NDArray a NDArray backed by a dlpack tensor cS`s5tj|ƒ}tjj|ƒ}tjj|ƒ|S(N(RFRRR¯R t Py_IncRef(tobjR:R9((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt_make_manager_ctxŽscS`sºt|jƒtjkr4tt|jƒdƒ‚ntƒ}|jjtjƒ|_ t ddƒ|_ |j |_ tjt|jƒ|_|jj tjƒ|_d|_d|_|S(Ns is not supported.ii(RfRRR!R,RvR-RFRRR†RRURutshape_asRRTRmR.R/(RR2((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt_make_dl_tensor”s    c`s4tƒ}ˆ|ƒ|_ˆ|ƒ|_t|_|S(N(R1R2R3R;R4(Rtc_obj(R@R>(s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyt_make_dl_managed_tensor¡s   RRt C_CONTIGUOUSs4Only c-contiguous arrays are supported for zero-copyt WRITEABLER_( RRRtflagsRvR¢RRRRRFRGRÉR(RÄt zero_copyRBRAR_((R@R>s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyR>vs      +(~R£t __future__RRt __builtin__RRÀt ImportErrortbuiltinsRRKRFR‰R t functoolsRtnumpyRQR×RRRRR R R R R RRRRRRjRRRRRRt__all__t_STORAGE_TYPE_UNDEFINEDt_STORAGE_TYPE_DEFAULTt_STORAGE_TYPE_ROW_SPARSEt_STORAGE_TYPE_CSRRmR(R)tfloat16tuint8RÃtint8R%RRt_STORAGE_TYPE_STR_TO_IDR~RRªR¶R¸R8RWR[R7RaRRµRËRRùRÑR3RR$R/RRÉR RÌRR5R1R"R0R4R-R.R#R2R%R&R(R)R*R+R,R6RR'RŽR!R„R9R¢R:t CFUNCTYPERtPyCapsuleDestructorRRRRR;R<R=t StructureRR!R-R1R©t DeleterFuncR R;R>(((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/ndarray/ndarray.pyts     ((                     ÿÿÿÿÿÿÿÿ@  +  &#! 47. 0 > > = 9 9 > 9 9 @ C @ @ @ ? < < 6 :$*$+%-      1