ó R;]c@`s±dZddlmZddlmZyddlmZWn!ek r]ddlmZnXddl m Z ddl Z ddl Z ddl Z ddlmZddlZdd lmZmZmZdd lmZmZmZmZdd lmZmZmZdd lmZdd lmZddl m!Z!ddl m"Z"ddl!m#Z#ddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.gZ$d/Z%dZ&dZ'dZ(id/e)6dej*6dej+6dej,6d0ej-6d1ej.6d2ej/6d3ej06Z1ie)d/6ej*d6ej+d6ej,d6ej-d06ej.d16ej/d26ej0d36Z2ie%d46e&d56e'd66e(d76Z3id4e%6d5e&6d6e'6d7e(6Z4idd86dd96d0d6Z5d/Z6dZ7dZ8d:„Z9ed;„Z:d<„Z;d=„Z<d>„Z=de#fd?„ƒYZ>d@„Z?ddA„Z@dB„ZAdC„ZBdD„ZCdE„ZDe)e)dF„ZEe)ee)dG„ZFe)e)dH„Z dI„ZGe)dJde)edK„ZHe)dL„ZIdM„ZJdN„ZKdO„ZLdP„ZMdQ„ZNdR„ZOdS„ZPdT„ZQdU„ZRdV„ZSdW„ZTdX„ZUdY„ZVdZ„ZWd[„ZXdeYd\„ZZddddfe)dd0e)d]„Z[e)e)d^„Z\dde)e)d_„Z]e)e)d`„Z^dS(asNDArray API of MXNet.i(tabsolute_import(tdivision(tslice(tarrayN(treducei(t_LIBt numeric_typest integer_types(tc_arrayt c_array_buftc_handle_arrayt mx_real_t(tmx_uintt NDArrayHandlet check_call(t ctypes2buffer(tContexti(t _internal(top(t NDArrayBasetNDArrayt concatenatet_DTYPE_NP_TO_MXt_DTYPE_MX_TO_NPt _GRAD_REQ_MAPtonestaddtarangeteyetdividetequaltfulltgreatert greater_equaltimdecodetlessert lesser_equaltmaximumtminimumtmoveaxistmodulotmultiplyt not_equalt onehot_encodetpowertsubtractt true_dividetwaitallt_new_empty_handleiÿÿÿÿ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. (R RRtMXNDArrayCreateNonetctypestbyref(thdl((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR0js 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(R RRtMXNDArrayCreateExR R t native_arraytlenR8tc_intt device_typeidt device_idtintRtnptdtypettypeR9(tshapetctxt delay_allocRDR:((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt_new_alloc_handleys  "c C`s~tƒ}ttjtj|ƒtj|ƒtt|ƒtt|ƒƒtjt t t j |ƒj ƒƒtj|ƒƒƒ|S(N(R RRtMXNDArrayCreateFromSharedMemR8R?RR R>RBRRCRDRER9(t shared_pidt shared_idRFRDR:((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt_new_from_shared_mems     "cC`sttjƒƒdS(shWait for all async operations to finish in MXNet. This function is used for benchmarking only. N(RRtMXNDArrayWaitAll(((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR/›scC`s5tjdƒ}ttj|tj|ƒƒƒ|jS(Ni(R8R?RRtMXNDArrayGetStorageTypeR9tvalue(thandlet storage_type((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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„ZXdT„ZYdU„ZZdV„Z[dW„Z\dX„Z]dY„Z^dZ„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„Zxdt„Zydu„Zzdv„Z{dw„Z|dx„Z}dy„Z~dz„Zd{„Z€d|„Zd}„Z‚ed~„ƒZƒed„ƒZ„ed€„ƒZ…ed„ƒZ†ed‚„ƒZ‡edƒ„ƒZˆed„„ƒZ‰ed…„ƒZŠeŠj‹d†„ƒZŠd‡„ZŒdˆ„ZeŽd‰„ZdŠ„Zd‹„Z‘dŒ„Z’dd“dŽ„Z”ed„ƒZ•d„Z–d“e—eŽd‘„Z˜d’„Z™RS(”s]An array object representing a multidimensional, homogeneous array of fixed-size items. g@@icC`s |jjS(N(RQRP(tself((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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>(tjoinRFtstrtasnumpyt __class__t__name__tcontext(RTRVt shape_info((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__repr__ºs) cC`std|jƒfS(N(N(RtNonet __getstate__(RT((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt __reduce__ÁscC`sbtjƒ}tjƒ}ttj|jtj|ƒtj|ƒƒƒ|j|j|j|j fS(N( R8R?RRtMXNDArrayGetSharedMemHandleRQR9RPRFRD(RTRKRL((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt_to_shared_memÄs    %cC`s t||ƒS(s)x.__add__(y) <=> x+y <=> mx.nd.add(x, y) (R(RTtother((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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 TypeErrorRXRE(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__iadd__Ïs cC`s |j|ƒS(N(Re(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__radd__ÚscC`s t||ƒS(s.x.__sub__(y) <=> x-y <=> mx.nd.subtract(x, y) (R-(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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 NDArrayRfstype %s not supportedN( RgRhRiRRt broadcast_subRRt _minus_scalarRlRmRXRE(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__isub__ás cC`s t||ƒS(s/x.__rsub__(y) <=> y-x <=> mx.nd.subtract(y, x) (R-(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__rsub__ìscC`s t||ƒS(s.x.__mul__(y) <=> x*y <=> mx.nd.multiply(x, y) (R)(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__mul__ðscC`stj|dƒS(sx.__neg__(y) <=> -x gð¿(Rt _mul_scalar(RT((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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 NDArrayRfstype %s not supportedN( RgRhRiRRt broadcast_mulRRRvRlRmRXRE(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__imul__øs cC`s |j|ƒS(N(Ru(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__rmul__scC`s t||ƒS(s,x.__div__(y) <=> x/y <=> mx.nd.divide(x, y) (R(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__div__scC`s t||ƒS(s-x.__rdiv__(y) <=> y/x <=> mx.nd.divide(y, x) (R(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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 NDArrayRfstype %s not supportedN( RgRhRiRRt broadcast_divRRt _div_scalarRlRmRXRE(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__idiv__s cC`s t||ƒS(N(R(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt __truediv__scC`s t||ƒS(N(R(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt __rtruediv__scC`s |j|ƒS(N(R(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt __itruediv__scC`s t||ƒS(s,x.__mod__(y) <=> x%y <=> mx.nd.modulo(x, y) (R((RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__mod__"scC`s t||ƒS(s-x.__rmod__(y) <=> y%x <=> mx.nd.modulo(y, x) (R((RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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 NDArrayRfstype %s not supportedN( RgRhRiRRt broadcast_modRRt _mod_scalarRlRmRXRE(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__imod__*s cC`s t||ƒS(s+x.__pow__(y) <=> x**y <=> mx.nd.power(x,y) (R,(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__pow__5scC`s t||ƒS(s+x.__pow__(y) <=> y**x <=> mx.nd.power(y,x) (R,(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__rpow__9scC`s t||ƒS(s+x.__eq__(y) <=> x==y <=> mx.nd.equal(x, y) (R(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__eq__=scC`st|ƒdS(sDefault hash function.i(tid(RT((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__hash__AscC`s t||ƒS(s/x.__ne__(y) <=> x!=y <=> mx.nd.not_equal(x, y) (R*(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__ne__EscC`s t||ƒS(s,x.__gt__(y) <=> x>y <=> mx.nd.greater(x, y) (R (RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__gt__IscC`s t||ƒS(s3x.__ge__(y) <=> x>=y <=> mx.nd.greater_equal(x, y) (R!(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__ge__MscC`s t||ƒS(s+x.__lt__(y) <=> x mx.nd.lesser(x, y) (R#(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__lt__QscC`s t||ƒS(s0x.__le__(y) <=> x<=y <=> mx.nd.less_equal(x, y) (R$(RTRd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__le__UscC`sTttj|jdƒ}|dkr(tS|dkrDt|jƒƒStdƒ‚dS(NiisBThe truth value of an NDArray with multiple elements is ambiguous.(RtoperatortmulRFtFalsetbooltasscalarRh(RTt num_elements((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__bool__Ys   cC`s |jdS(s'Number of element along the first axis.i(RF(RT((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt__len__escC`sŽ|j}idd6}|dk rŠtjƒ}tjtjƒƒ}ttj|jtj |ƒtj |ƒƒƒt ||j ƒ|dt from_bufferRšRRtMXNDArrayLoadFromRawBytesR9RQ(RTtstateRQtbuftptrRŸ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt __setstate__us   " cC`svt|ƒ}|tkr+|j||ƒnG|tkrJ|j||ƒn(tdt|ƒtt|ƒƒfƒ‚dS(s‰x.__setitem__(i, y) <=> 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, 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_indexingRhRXRE(RTtkeyRPtindexing_dispatch_code((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt __setitem__ƒs7   cC`sjt|ƒ}|tkr%|j|ƒS|tkr>|j|ƒStdt|ƒtt|ƒƒfƒ‚dS(ssx.__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, 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_indexingRhRXRE(RTR¬R­((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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}|||RFR_t enumeratetTrueRR\tappendt_get_index_rangetstarttstoptstepRR”RDtastypet IndexErrort_get_broadcast_shapeRhtrangetextendtreshapet broadcast_toRtstack(RTR¬R´RFtindicesRDtneed_broadcasttadvanced_indicest basic_indicestadvanced_index_bshapetitidx_itis_advanced_indexR¾R¿RÀtadvanced_indices_adjacenttindex_bshape_listt index_bshapetbroadcasted_indicest idx_rshapetadvanced_index_bshape_starttadvanced_index_bshape_stoptidxtktdim_sizetjt_tbasic_index_offset((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt _get_index_ndsÎ ! " +!  &!"      $       ! ")   !  ) c C`sýt|tƒr9td|d|d|jd|jƒ}nŸt|tƒr„|j|jƒ}|j|jkrØ|j|jƒ}qØnTy"t|d|jd|jƒ}Wn/t dt |ƒt t |ƒƒfƒ‚nX|j |krù|j |ƒ}n|S(sGiven value and vshape, create an `NDArray` from value with the same context and dtype as the current one and broadcast it to vshape.RFtvalRGRDsLNDArray does not support assignment with non-array-like object %s of type %s(RiRRR\RDRt as_in_contextRÁRRmRXRERFRÇ(RTRPtvshapetvalue_nd((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt_prepare_value_nd”s*"&c C`s€|j}t|tƒr2|j|ƒ}||(dSt|tƒrË|jdks_|jdkr¿|jdk s}|jdk r |j |j|jƒ}||(dSt|t ƒrõ|j |j k r»|j|krâ|j |ƒ}n|j |ƒq»nÆt|tƒr;tjd|d|jd|jdt|ƒd|ƒn€t|tjtjfƒrœt|tjƒsw|j|krŒtj ||ƒ}n|j|ƒn|j||ƒ}|j |ƒdS|f}nt|tƒsðtdt|ƒƒ‚t|ƒt|ƒks*td t|ƒt|ƒfƒ‚g}g}g}g} g} x7t|ƒD])\} } d} t| tƒró|j| jƒ|j| jƒ|j| jƒt| j| j|| | jƒ\}}}t |||ƒ} | j| ƒn~t| tƒrI|j| ƒ|j| d kr+| dn |j| ƒ|jdƒn(t!d t| ƒtt"| ƒƒfƒ‚| j| ƒqUW| j#|t|ƒƒ| j#|t|ƒƒt| ƒd krÒ| jdƒnt| ƒ} t| ƒ} t|tƒr-tj$|d|d |d|d|dt|ƒƒnO|j|| ƒ}| | kr]|j%| ƒ}ntj&|||||d|ƒdS(sÁThis function is called by __setitem__ when key is a basic index, i.e. an integer, or a slice, or a tuple of integers and slices. No restrictions on the values of slices' steps.NiRFRGRDRPRfs-key=%s must be a tuple of slices and integerss5Indexing dimensions exceed array dimensions, %d vs %diÿÿÿÿs3basic indexing does not support index=%s of type=%sitbegintendRÀtscalar('RFRiRt_atR²RÀR_R¾R¿t_sliceRRQRÇtcopytoRRt_fullR\RDRlRCR¶tgenerict_sync_copyfromRãR¸R¹RXR>RºR¼R½t _get_dim_sizeRhRERÅt_slice_assign_scalarRÆt _slice_assign(RTR¬RPRFt sliced_arrRâRäRåtstepstoshapeRáRÎtslice_iRÚR¾R¿RÀ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR©§s‚ !  % *"   c C`s_|j|ƒ}t|j|jƒ}|j||ƒ}tjd|d|d|jd|ƒdS(sEThis function is called by __setitem__ when key is an advanced index.tdataRÉRFRfN(RÞt_get_oshape_of_gather_nd_opRFRãRt_scatter_set_nd(RTR¬RPRÉRáRâ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR«øsc C`s—|j}t|tƒrX||ddkrKtdj||dƒƒ‚n|j|ƒSt|tƒr|jdk rÔ|jdkrÔ|jdkr£t dƒ‚nt j |d|j fd|j fd|jfƒS|j dk sò|j dk r|j|j |j ƒS|Snt|tƒsIt dt|ƒtt|ƒƒfƒ‚nt|ƒdksgtd ƒ‚g}g}g}g}d }xt|ƒD] \}}t|tƒrô|j|ƒ|j|d krÖ|dn |j|ƒ|jdƒq’t|tƒrw|jdkr7t d t|ƒt|ƒfƒ‚n|j|j ƒ|j|j ƒ|j|jƒ|j|ƒq’t d t|ƒtt|ƒƒfƒ‚q’W|jt|dt|ƒƒƒt j ||||ƒ} t|ƒt|ƒkr÷| Sg} | j} x|D]} | j| | ƒq Wt| ƒdkrJ| jdƒnt| ƒ} tj| ƒtj| ƒksŠtd | | fƒ‚| j| ƒS(sdThis function is called when key is a slice, or an integer, or a tuple of slices or integersiis1index {} is out of bounds for axis 0 with size {}sslice step cannot be zeroRäRåRÀsqindex=%s must be a slice, or an ineger, or a tuple of slices and integers to use basic indexing, received type=%ss$basic index cannot be an empty tupleiÿÿÿÿs1basic index=%s cannot have slice=%s with step = 0sAbasic_indexing does not support slicing with index=%s of type=%s.s1oshape=%s has different size than sliced_shape=%sN(RFRiRRÂtformatRçR²RÀR_RhRRR¾R¿RèR¸RXRER>R¹RºR¼RÅRÄRCtprodRÆ( RTR¬RFRäRåRÀt kept_axesRÎRót sliced_ndRòt sliced_shapetaxis((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR¯ÿsj  1% *&    $cC`stj||j|ƒƒS(sGet item when key is a tuple of any objects of the following types: NDArray, np.ndarray, list, tuple, slice, and integer.(Rt gather_ndRÞ(RTR¬((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR°@scC`sët|tjƒs[ytj|d|jƒ}Wq[tddtttƒƒƒ‚q[Xntj|d|jƒ}|j |j kr°t dt|j ƒt|j ƒfƒ‚nt t j |j|jjtjƒtj|jƒƒƒdS(sPerforms a synchronized copy from the `source_array` to the current array. This is called through ``x[:] = source_array``, where the `source_array` is a `numpy.ndarray` or array-like object. This function blocks until all the pending read/write operations with respect to the current `NDArray` are finished and carry out the copy operation to the current NDArray. Parameters ---------- source_array : array_like The data source we would like to copy from. Example ------- >>> 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) RDs&array must consist of array-like data,stype %s is not supporteds)Shape inconsistent: expected %s vs got %sN(RiRCR¶RRDRmRXREtascontiguousarrayRFRhRRtMXNDArraySyncCopyFromCPURQR8tdata_astc_void_pRštsize(RTt source_array((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRìEs!% 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) iRQRg( R R½RFRRtMXNDArraySliceRQR R8R9RRg(RTR¾R¿RQRÜ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRèjs  " +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 %dRQRg( R RFRÂRRt MXNDArrayAtRQR R8R9RRg(RTRØRQRŸ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRçˆs      "cO`st|ƒdkr8t|dttfƒr8|d}nv|s›|jdƒ}|s_tdƒ‚t|ƒdkr®tdjdj|j ƒƒƒƒ‚q®n| s®tdƒ‚t ƒ}t t j |jt|ƒttj|ƒtj|ƒƒƒtd|d |jƒS( s< Returns 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) 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) iiRFsShape must be provided.s7Only 'shape' is supported as keyword argument. Got: {}.s, sKSpecifying both positional and keyword arguments is not allowed in reshape.RQRg(R>RiR·R¸tgetR¹RmR÷RWtkeysR RRtMXNDArrayReshape64RQRR8tc_int64R9RRg(RTRFtkwargsRQ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRƪs Y+  !    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(RTtargsR ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR scO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR/scO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR7scO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR?scO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRGscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyROscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRWscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRgscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRoscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRwscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR§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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR¯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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR·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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR ¿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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR!Ç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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR"Ï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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR#×scO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR$ßscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR&ïscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR(ÿscO`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ø(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRøscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR)scO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR*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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR+scO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR,'scO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR-/scO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR.7scO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR/?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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR0GscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR1OscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR2WscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR3_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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR4gscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR5oscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR6wscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR7scO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR8‡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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR9scO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR:—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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR;Ÿ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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR<§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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR=¯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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR>·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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR?¿scO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR@ÇscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRAÏscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRB×scO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRCß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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRDç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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyREïscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRF÷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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRGÿscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRHscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRIscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRJscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRKscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRL'scO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRM/scO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRN7scO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRO?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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRPGscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRQOscO`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(RTR R ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRRWscC`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 {}iRFN(i( RFR÷R>RhRCRtnonzerotanyRRÇRÆR¸(RTRFt cur_shapeterr_strt cur_shape_arrtbroadcasting_axes((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRÇ`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(RRtMXNDArrayWaitToReadRQ(RT((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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 (R>RF(RT((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pytndim¨s cC`sZtƒ}tjtƒƒ}ttj|jtj|ƒtj|ƒƒƒt||j ƒS(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) ( R R8R›RRtMXNDArrayGetShapeRQR9R¸RP(RTR[tpdata((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRF·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(RF(RTRRÎ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRËscC`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) ( R8R?RRtMXNDArrayGetContextRQR9Rt devtype2strRP(RTt dev_typeidtdev_id((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR\ßs    %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 ( R8R?RRtMXNDArrayGetDTypeRQR9RRP(RTtmx_dtype((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRDôs  cC`stt|jƒS(s#Storage-type of the array. (t_STORAGE_TYPE_ID_TO_STRRSRQ(RT((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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(R>RFRR%(RT((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pytTscC`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). (R8R?RRtMXNDArrayGetGradStateRQR9RP(RTRf((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt _fresh_grad-s "cC`s&ttj|jtj|ƒƒƒdS(N(RRtMXNDArraySetGradStateRQR8R?(RTR£((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRh;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) RD( RCtemptyRFRDRRtMXNDArraySyncCopyToCPURQR8RRRšR(RTRô((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRY?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(RFRhRY(RT((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR–Ws 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 RGRD(RCRDRjRFR\Ré(RTRDtcopytres((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRÁhs  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 itselfRfscopyto does not support type N(RiRRQtwarningstwarntRuntimeWarningR”Rt_copytoRRIRFR»RDRmRXRE(RTRdthret((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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éR\(RT((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRl¹scC`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 (R\Ré(RTR\((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRàËsR6cC`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(tzerosReN(tRsR_RFRR RRRtMXAutogradMarkVariablesR8tpointerRQR (RTtgrad_reqRet_zerostgrad((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt attach_gradês   cC`sXddlm}tƒ}ttj|jtj|ƒƒƒ|j dkrNdS||ƒS(s1Returns gradient buffer attached to this NDArray.i(t _ndarray_clsN( RtR{R RRtMXNDArrayGetGradRQR8R9RPR_(RTR{R:((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRys  "cC`sEddlm}tƒ}ttj|jtj|ƒƒƒ||ƒS(s7Returns a new NDArray, detached from the current graph.i(R{( RtR{R RRtMXNDArrayDetachRQR8R9(RTR{R:((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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( R_R RQRRtMXAutogradBackwardExR RR8RR?(RTtout_gradt retain_grapht train_modet ograd_handles((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pytbackwards         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 Re(Rt cast_storage(RTRe((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyttostype2s N(šR[t __module__t__doc__t __slots__t__array_priority__t _tvm_tcodetpropertyRUR^RaRcReRnRoRpRsRtRuRwRyRzR{R|RR€RR‚RƒR„R‡RˆR‰RŠRŒRRŽRRR‘R˜t __nonzero__R™R`R¦R®R±RÞRãR©R«R¯R°RìRèRçRÆR R RRRRRRRRRRRRRRRRRRRR R!R"R#R$R%R&R'R(RøR)R*R+R,R-R.R/R0R1R2R3R4R5R6R7R8R9R:R;R<R=R>R?R@RARBRCRDRERFRGRHRIRJRKRLRMRNRORPRQRRRÇRZR[RFRR\RDReRfRhtsetterRYR–R»RÁRéRlRàR_RzRyR~R”R„R†(((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR©s(                              B = ’  Q  A  %  " m                                                                         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(RiRRCR¶RªR·RRmRXRER²R¨R¸Rht_NDARRAY_UNSUPPORTED_INDEXING(R¬RÎRØ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR§As& ) )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(RhR_RÂ(R¾R¿RŸRÀ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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(R>R¹R·RÅR¸(tdshapetishapeRò((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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Ú((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRí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(R>R·R+tzipRhR¸(tshape1tshape2tlength1tlength2RFRÎtatb((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRÃs     6$cC`stj||d|ƒS(stOne-hot encoding indices into matrix out. .. note:: `onehot_encode` is deprecated. Use `one_hot` instead. Rf(Rt_onehot_encode(RÉRf((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR+²scK`sO|dkrtj}n|dkr*tn|}tjd|d|d||S(sZReturns 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.default_ctx``). 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) RFRGRDN(R_Rt default_ctxR Rt_ones(RFRGRDR ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR½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(R_Rj(RFRßRGRDRf((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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`. RDs&source_array must be array like objectN( RiRR_RDR RCR¶RRmRjRF(RRGRDtarr((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR scC`s’tt|jƒƒ}y|j|ƒWn!tk rItd|ƒ‚nXy|j||ƒWn!tk rtd|ƒ‚nXtj||ƒS(s?Moves 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 Original position of the axes to move. destination : int Destination position for each of the original axes. 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) s4Source should verify 0 <= source < tensor.ndimGot %ds>Destination should verify 0 <= destination < tensor.ndimGot %d( R·RÄR[tpopRÂRhtinsertRR%(ttensortsourcet destinationtaxes((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR'' s  gð?cC`sL|dkrtj}ntjd|d|d|d|d|dt|ƒƒS(sßReturns 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. 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) R¾R¿RÀRRDRGN(R_RRšRt_arangeRX(R¾R¿RÀRRGRD((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRN 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(RiRR_RlRRmRXRE(tlhstrhstfn_arrayt fn_scalart lfn_scalart rfn_scalar((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyt _ufunc_helper s   cC`s"t||tjtjtjdƒS(sReturns 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 array First array to be added. rhs : scalar or 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ªRRjR’RRRkR_(R¤R¥((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/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 array First array to be subtracted. rhs : scalar or 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ªRRqR’tsubRRrt_rminus_scalar(R¤R¥((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR-í 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 array First array to be multiplied. rhs : scalar or 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ªRRxR’R“RRvR_(R¤R¥((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR)+ s3cC`s%t||tjtjtjtjƒS(sûReturns 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 array First array in division. rhs : scalar or 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(R¤R¥((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRh s/cC`s%t||tjtjtjtjƒS(søReturns 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 array First array in modulo. rhs : scalar or 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(R¤R¥((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR(¡ 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(tbaseRB((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR,Ú s4cC`s"t||tjd„tjdƒS(s,Returns 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 array First array to be compared. rhs : scalar or 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((RVty((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pytK sN(RªRtbroadcast_maximumRt_maximum_scalarR_(R¤R¥((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR% s/cC`s"t||tjd„tjdƒS(s,Returns 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 array First array to be compared. rhs : scalar or 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((RVR¶((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR·„ sN(RªRtbroadcast_minimumRt_minimum_scalarR_(R¤R¥((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR&Q s/cC`s"t||tjd„tjdƒS(sReturns 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 array First array to be compared. rhs : scalar or 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((RVR¶((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR·Ä sN(RªRtbroadcast_equalRt _equal_scalarR_(R¤R¥((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRŠ s6cC`s"t||tjd„tjdƒS(szReturns 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 array First array to be compared. rhs : scalar or 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((RVR¶((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR· sN(RªRtbroadcast_not_equalRt_not_equal_scalarR_(R¤R¥((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR*Ê s9cC`s%t||tjd„tjtjƒS(sReturns 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 array First array to be compared. rhs : scalar or 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((RVR¶((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR·G s(RªRtbroadcast_greaterRt_greater_scalart_lesser_scalar(R¤R¥((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR s6cC`s%t||tjd„tjtjƒS(s;Returns 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 array First array to be compared. rhs : scalar or 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((RVR¶((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR·‡ s(RªRtbroadcast_greater_equalRt_greater_equal_scalart_lesser_equal_scalar(R¤R¥((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR!M s6cC`s%t||tjd„tjtjƒS(sReturns 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 array First array to be compared. rhs : scalar or 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((RVR¶((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR·Ç s(RªRtbroadcast_lesserRRÂRÁ(R¤R¥((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR# s6cC`s%t||tjd„tjtjƒS(s7Returns 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 array First array to be compared. rhs : scalar or 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((RVR¶((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR· s(RªRtbroadcast_lesser_equalRRÅRÄ(R¤R¥((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR$Í s6cC`s t||ƒS(s0This function is similar to :meth:`divide`. (R(R¤R¥((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR. 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|| |RRFRDRjR\Rt _crop_assignR¸(tarraysRüt always_copyt shape_axist shape_rest1t shape_rest2RDRœt ret_shapetretRØRÜRäRå((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR s:       c C`s°|dkrttƒƒ}n|dkrhtj|||d|d|d|d|t|ƒd|ƒStj|||d|d|d|d|t|ƒd|d|ƒSdS(s3DEPRECATED, use mx.img instead Parameters ---------- str_img : str Binary image data clip_rect : iterable of 4 int Clip decoded image to rectangle (x0, y0, x1, y1). out : NDArray Output buffer. Can be 3 dimensional (c, h, w) or 4 dimensional (n, c, h, w). index : int Output decoded image to i-th slice of 4 dimensional buffer. channels : int Number of channels to output. Decode to grey scale when channels = 1. mean : NDArray Subtract mean from decode image before outputing. iiiitstr_imgRfN(R_RR0Rt _imdecodeR>(RÐt clip_rectRfR³tchannelsR*((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyR"N s(      cK`sO|dkrtj}n|dkr*tn|}tjd|d|d||S(sReturns a new array filled with all zeros, with the given shape and type. 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`). out : NDArray, optional The output NDArray (default is `None`). Returns ------- NDArray A created array Examples -------- >>> 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) RFRGRDN(R_RRšR RRx(RFRGRDR ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRsx s  c K`s[|dkrtj}n|dkr*tn|}tjd|d|d|d|d||S(svReturn 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ÙRGRDN(R_RRšR Rt_eye(RÔRÕRÙRGRDR ((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRœ s  cC`sdt|tƒr|f}n|dkr3tj}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. RQN( RiRBR_RRšR RRIR”(RFRGRD((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pyRjÄ s     (_Rˆt __future__RRt __builtin__RR²t ImportErrortbuiltinsRR=R8RnR’t functoolsRtnumpyRCRµRRRRR R R R R RRR\RRtRRRt__all__t_STORAGE_TYPE_UNDEFINEDt_STORAGE_TYPE_DEFAULTt_STORAGE_TYPE_ROW_SPARSEt_STORAGE_TYPE_CSRR_tfloat32tfloat64tfloat16tuint8Rµtint8tint64RRt_STORAGE_TYPE_STR_TO_IDRdRRR¨RªR0RIRMR/RSRR§R½RõRíRÃR+RRR'RRªRR-R)RR(R,R%R&RR*R R!R#R$R.R»RR"RsRRj(((sU/usr/local/lib/python2.7/site-packages/mxnet-1.2.1-py2.7.egg/mxnet/ndarray/ndarray.pytsÚ     "                      ÿÿÿÿÿÿÿŸ  +  &#! '1 0 > > = 9 9 > 9 9 @ C @ @ @ @ :$*$(