ó ùµÈ[c@@sëdZddlmZyddlmZWn!ek rMddlmZnXddl m Z ddl Z ddl Z ddl m Z ddlZddlmZdd lmZmZmZmZmZmZmZdd lmZmZmZmZdd lmZmZm Z dd lm!Z!m"Z"m#Z#dd l$m%Z%m&Z&ddl'm(Z(m)Z)m*Z*m+Z+ddl,m-Z-ddl'm.Z.ddl/m0Z0ddl1m2Z2ddl1m3Z3ddl2m4Z4m5Z5ddddddddddd d!d"d#d$d%gZ6de4fd&„ƒYZ7e8e8e8e8e8e8e8d'„Z9e9Z:d(„Z;d)„Z<d*„Z=d+„Z>d,„Z?d-„Z@d.„ZAdde8d/„ZBe8d0„ZCe8d1„ZDe8d2„ZEe8d3deFe8e8d4„ZGd5e8d6„ZHe5e7ƒdS(7s$Symbolic configuration API of MXNet.i(tabsolute_import(tslice(tarrayN(tNumberi(t AttrScope(t_LIBt numeric_typestc_arrayt c_array_buftc_strt c_str_arraytc_handle_array(tmx_uinttpy_strt string_typest integer_types(t NDArrayHandletExecutorHandlet SymbolHandle(t check_callt MXNetErrortNotImplementedForSymbol(tContexttcurrent_context(tNDArrayt_DTYPE_NP_TO_MXt_DTYPE_MX_TO_NPt _GRAD_REQ_MAP(t_STORAGE_TYPE_STR_TO_ID(t _ndarray_cls(tExecutori(t _internal(top(t SymbolBaset_set_symbol_classtSymboltvartVariabletGrouptloadt load_jsontpowtmaximumtminimumthypotteyetzerostonestfulltaranget histogramcB@s¨eZdZgZdZd„Zd„Zd„Zd„ZeZ 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'd$„Z(d%„Z)e*d&„ƒZ+d'„Z,e-d(„Z.d)„Z/d*„Z0d+„Z1d,„Z2d-„Z3d.„Z4d/„Z5d0„Z6d1„Z7d2„Z8d3„Z9d4„Z:d5„Z;d6„Z<d7„Z=d8„Z>e?d9„ƒZ@d:eAeAeAeAeAeAd;„ZBeAd:eAeAeAd<„ZCd=„ZDeAd>„ZEd?„ZFd@„ZGdA„ZHdB„ZIdC„ZJdD„ZKdE„ZLdF„ZMdG„ZNdH„ZOdI„ZPdJ„ZQdK„ZRdL„ZSdM„ZTdN„ZUdO„ZVdP„ZWdQ„ZXdR„ZYdS„ZZdT„Z[dU„Z\dV„Z]dW„Z^dX„Z_dY„Z`dZ„Zad[„Zbd\„Zcd]„Zdd^„Zed_„Zfd`„Zgda„Zhdb„Zidcdd„Zjde„Zkdf„Zldg„Zmdh„Zndi„Zodj„Zpdk„Zqdl„Zrdm„Zsdn„Ztdo„Zudp„Zvdq„Zwdr„Zxds„Zydt„Zzdu„Z{dv„Z|dw„Z}dx„Z~dy„Zdz„Z€d{„Zd|„Z‚d}„Zƒd~„Z„d„Z…d€„Z†d„Z‡d‚„Zˆdƒ„Z‰d„„ZŠd…„Z‹d†„ZŒd‡„Zdˆ„ZŽd‰„ZdŠ„Zd‹„Z‘dŒ„Z’d„Z“dŽ„Z”d„Z•d„Z–d‘„Z—d’„Z˜d“„Z™d”„Zšd•„Z›d–„Zœd—„Zd˜„Zžd™„ZŸdš„Z RS(›s&Symbol is symbolic graph of the mxnet.g@@cC@sf|j}|dkrNdjg|D]}|j^q"ƒ}d|jj|fSd|jj|fSdS(s+Gets a string representation of the symbol.s, s<%s group [%s]>s<%s %s>N(tnametNonetjoint __class__t__name__(tselfR3ti((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__repr__?s   %c@s‡fd†ˆjƒDƒS(sÜReturns a generator object of symbol. One can loop through the returned object list to get outputs. Example ------- >>> a = mx.sym.Variable('a') >>> b = mx.sym.Variable('b') >>> c = a+b >>> d = mx.sym.Variable('d') >>> e = d+c >>> out = e.get_children() >>> out >>> for i in out: ... i ... c3@s|]}ˆ|VqdS(N((t.0R9(R8(sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pys ]s(t list_outputs(R8((R8sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__iter__HscC@sat|tƒrtj||ƒSt|tƒrAtj|d|ƒStdtt|ƒƒƒ‚dS(s}x.__add__(y) <=> x+y Scalar input is supported. Broadcasting is not supported. Use `broadcast_add` instead. tscalarstype %s not supportedN( t isinstanceR#Rt_PlusRt _PlusScalart TypeErrortstrttype(R8tother((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__add___s cC@st|jdƒ‚dS(Ntbool(Rt__bool__(R8((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRHkscC@st|jd|dƒ‚dS(Ns+=i(Rt__iadd__(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRIpscC@s |j|ƒS(N(RF(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__radd__sscC@sat|tƒrtj||ƒSt|tƒrAtj|d|ƒStdtt|ƒƒƒ‚dS(s}x.__sub__(y) <=> x-y Scalar input is supported. Broadcasting is not supported. Use `broadcast_sub` instead. R>stype %s not supportedN( R?R#Rt_MinusRt _MinusScalarRBRCRD(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__sub__vs cC@st|jd|ƒ‚dS(Ns-=(Rt__isub__(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRN‚scC@sBt|tƒr"tj|d|ƒStdtt|ƒƒƒ‚dS(s'x.__rsub__(y) <=> y-x Only `NDArray` is supported for now. Example ------- >>> x = mx.nd.ones((2,3))*3 >>> y = mx.nd.ones((2,3)) >>> x.__rsub__(y).asnumpy() array([[-2., -2., -2.], [-2., -2., -2.]], dtype=float32) R>stype %s not supportedN(R?RRt _RMinusScalarRBRCRD(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__rsub__…s cC@sat|tƒrtj||ƒSt|tƒrAtj|d|ƒStdtt|ƒƒƒ‚dS(s}x.__mul__(y) <=> x*y Scalar input is supported. Broadcasting is not supported. Use `broadcast_mul` instead. R>stype %s not supportedN( R?R#Rt_MulRt _MulScalarRBRCRD(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__mul__—s cC@st|jd|ƒ‚dS(Ns*=(Rt__imul__(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRT£scC@s |j|ƒS(N(RS(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__rmul__¦scC@sat|tƒrtj||ƒSt|tƒrAtj|d|ƒStdtt|ƒƒƒ‚dS(s}x.__div__(y) <=> x/y Scalar input is supported. Broadcasting is not supported. Use `broadcast_div` instead. R>stype %s not supportedN( R?R#Rt_DivRt _DivScalarRBRCRD(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__div__©s cC@sBt|tƒr"tj|d|ƒStdtt|ƒƒƒ‚dS(sWx.__rdiv__(y) <=> y/x Only `NDArray` is supported for now. Example ------- >>> x = mx.nd.ones((2,3))*3 >>> y = mx.nd.ones((2,3)) >>> x.__rdiv__(y).asnumpy() array([[ 0.33333334, 0.33333334, 0.33333334], [ 0.33333334, 0.33333334, 0.33333334]], dtype=float32) R>stype %s not supportedN(R?RRt _RDivScalarRBRCRD(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__rdiv__µs cC@sat|tƒrtj||ƒSt|tƒrAtj|d|ƒStdtt|ƒƒƒ‚dS(s}x.__mod__(y) <=> x%y Scalar input is supported. Broadcasting is not supported. Use `broadcast_mod` instead. R>stype %s not supportedN( R?R#Rt_ModRt _ModScalarRBRCRD(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__mod__Çs cC@sBt|tƒr"tj|d|ƒStdtt|ƒƒƒ‚dS(s$x.__rmod__(y) <=> y%x Only `NDArray` is supported for now. Example ------- >>> x = mx.nd.ones((2,3))*3 >>> y = mx.nd.ones((2,3)) >>> x.__rmod__(y).asnumpy() array([[ 1., 1., 1., [ 1., 1., 1., dtype=float32) R>stype %s not supportedN(R?RRt _RModScalarRBRCRD(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__rmod__Ós cC@st|jd|ƒ‚dS(Ns/=(Rt__idiv__(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR`åscC@s |j|ƒS(N(RX(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt __truediv__èscC@s |j|ƒS(N(RZ(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt __rtruediv__ëscC@st|jd|ƒ‚dS(Ns/=(Rt __itruediv__(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRcîscC@sat|tƒrtj||ƒSt|tƒrAtj|d|ƒStdtt|ƒƒƒ‚dS(s~x.__pow__(y) <=> x**y Scalar input is supported. Broadcasting is not supported. Use `broadcast_pow` instead. R>stype %s not supportedN( R?R#Rt_PowerRt _PowerScalarRBRCRD(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__pow__ñs cC@st|jd|ƒ‚dS(Nsy**x(Rt__rpow__(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRgýscC@s |jdƒS(sÍx.__neg__() <=> -x Numerical negative, element-wise. Example ------- >>> a = mx.sym.Variable('a') >>> a >>> -a >>> a_neg = a.__neg__() >>> c = a_neg*b >>> ex = c.eval(ctx=mx.cpu(), a=mx.nd.ones([2,3]), b=mx.nd.ones([2,3])) >>> ex[0].asnumpy() array([[-1., -1., -1.], [-1., -1., -1.]], dtype=float32) gð¿(RS(R8((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__neg__scC@s |jdƒS(N(t __deepcopy__R4(R8((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__copy__scC@s5tƒ}ttj|jtj|ƒƒƒt|ƒS(sReturns a deep copy of the input object. This function returns a deep copy of the input object including the current state of all its parameters such as weights, biases, etc. Any changes made to the deep copy do not reflect in the original object. Example ------- >>> import copy >>> data = mx.sym.Variable('data') >>> data_1 = copy.deepcopy(data) >>> data_1 = 2*data >>> data_1.tojson() >>> data_1 is data # Data got modified False (RRRt MXSymbolCopythandletctypestbyrefR#(R8t_Rl((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRis cC@sat|tƒrtj||ƒSt|tƒrAtj|d|ƒStdtt|ƒƒƒ‚dS(sx.__eq__(y) <=> x==y Scalar input is supported. Broadcasting is not supported. Use `broadcast_equal` instead. R>stype %s not supportedN( R?R#Rt_equalRt _equal_scalarRBRCRD(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__eq__/s cC@sat|tƒrtj||ƒSt|tƒrAtj|d|ƒStdtt|ƒƒƒ‚dS(sƒx.__ne__(y) <=> x!=y Scalar input is supported. Broadcasting is not supported. Use `broadcast_not_equal` instead. R>stype %s not supportedN( R?R#Rt _not_equalRt_not_equal_scalarRBRCRD(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__ne__;s cC@sat|tƒrtj||ƒSt|tƒrAtj|d|ƒStdtt|ƒƒƒ‚dS(s€x.__gt__(y) <=> x>y Scalar input is supported. Broadcasting is not supported. Use `broadcast_greater` instead. R>stype %s not supportedN( R?R#Rt_greaterRt_greater_scalarRBRCRD(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__gt__Gs cC@sat|tƒrtj||ƒSt|tƒrAtj|d|ƒStdtt|ƒƒƒ‚dS(s‡x.__ge__(y) <=> x>=y Scalar input is supported. Broadcasting is not supported. Use `broadcast_greater_equal` instead. R>stype %s not supportedN( R?R#Rt_greater_equalRt_greater_equal_scalarRBRCRD(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__ge__Ss cC@sat|tƒrtj||ƒSt|tƒrAtj|d|ƒStdtt|ƒƒƒ‚dS(sx.__lt__(y) <=> xstype %s not supportedN( R?R#Rt_lesserRt_lesser_scalarRBRCRD(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__lt___s cC@sat|tƒrtj||ƒSt|tƒrAtj|d|ƒStdtt|ƒƒƒ‚dS(s†x.__le__(y) <=> x<=y Scalar input is supported. Broadcasting is not supported. Use `broadcast_lesser_equal` instead. R>stype %s not supportedN( R?R#Rt _lesser_equalRt_lesser_equal_scalarRBRCRD(R8RE((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__le__ks cC@s5|j}|dk r&i|jƒd6Sidd6SdS(NRl(RlR4ttojson(R8Rl((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt __getstate__ws  cC@sc|d}|dk rV|}tƒ}ttjt|ƒtj|ƒƒƒ||_n d|_dS(NRl( R4RRRtMXSymbolCreateFromJSONR RmRnRl(R8tstateRltjson_str((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt __setstate__~s   % cO@s |jƒ}|j||Ž|S(sJComposes symbol using inputs. x.__call__(y, z) <=> x(y,z) This function internally calls `_compose` to compose the symbol and returns the composed symbol. Example ------- >>> data = mx.symbol.Variable('data') >>> net1 = mx.symbol.FullyConnected(data=data, name='fc1', num_hidden=10) >>> net2 = mx.symbol.FullyConnected(name='fc3', num_hidden=10) >>> composed = net2(fc3_data=net1, name='composed') >>> composed >>> called = net2.__call__(fc3_data=net1, name='composed') >>> called Parameters ---------- args: Positional arguments. kwargs: Keyword arguments. Returns ------- The resulting symbol. (Rjt_compose(R8targstkwargsts((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__call__‰s cO@sE|jddƒ}|r't|ƒ}nt|ƒdkrZt|ƒdkrZtdƒ‚nx,|D]$}t|tƒsatdƒ‚qaqaWx2|jƒD]$}t|tƒs–tdƒ‚q–q–Wt|ƒt|ƒ}t|ƒdkr t|j ƒƒ}t |jƒƒ}nd}t |ƒ}t t j |j||||ƒƒdS(s»Composes symbol using inputs. x._compose(y, z) <=> x(y,z) This function mutates the current symbol. Example ------- >>> data = mx.symbol.Variable('data') >>> net1 = mx.symbol.FullyConnected(data=data, name='fc1', num_hidden=10) >>> net2 = mx.symbol.FullyConnected(name='fc3', num_hidden=10) >>> net2 >>> net2._compose(fc3_data=net1, name='composed') >>> net2 Parameters ---------- args: Positional arguments. kwargs: Keyword arguments. Returns ------- The resulting symbol. R3isecompose only accept input Symbols either as positional or keyword arguments, not boths$Compose expect `Symbol` as argumentsN(tpopR4R tlenRBR?R#tvaluesR tkeysR RRtMXSymbolComposeRl(R8R‰RŠR3targtvaltnum_argsR((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRˆ­s($    c C@s°t|ƒ}t|tƒr¢|jdkr0dn|j}|jdkrN|n|j}|jdkrldn|j}tgt|||ƒD]}||^q‹ƒSt|t ƒr<|j ƒ}d}xNt |ƒD]@\}} | |krÐ|dk rt d|ƒ‚n|}qÐqÐW|dkr3t d|ƒ‚n|}nt|t ƒsZtdƒ‚n||krot‚ntƒ} ttj|jt|ƒtj| ƒƒƒtd| ƒS(sGx.__getitem__(i) <=> x[i] Returns a sliced view of the input symbol. Example ------- >>> a = mx.sym.var('a') >>> a.__getitem__(0) >>> a[0] Parameters ---------- index : int or str Indexing key iis)There are multiple outputs with name "%s"s)Cannot find output that matches name "%s"s6Symbol only support integer index to fetch i-th outputRlN(RŽR?tpy_slicetstartR4tstoptstepR&trangeRR<t enumeratet ValueErrortintRBt IndexErrorRRRtMXSymbolGetOutputRlR RmRnR#( R8tindext output_countR–R—R˜R9t output_namestidxR3Rl((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt __getitem__äs2 -          "cC@sjtjƒ}tjƒ}ttj|jtj|ƒtj|ƒƒƒ|jdkrbt |jƒSdSdS(sÚGets name string from the symbol, this function only works for non-grouped symbol. Returns ------- value : str The name of this symbol, returns ``None`` for grouped symbol. iN( Rmtc_char_ptc_intRRtMXSymbolGetNameRlRntvalueR R4(R8trettsuccess((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR3s   % cC@sstjƒ}tjƒ}ttj|jt|ƒtj|ƒtj|ƒƒƒ|j dkrkt |j ƒSdSdS(s$Returns the attribute string for corresponding input key from the symbol. This function only works for non-grouped symbols. Example ------- >>> data = mx.sym.Variable('data', attr={'mood': 'angry'}) >>> data.attr('mood') 'angry' Parameters ---------- key : str The key corresponding to the desired attribute. Returns ------- value : str The desired attribute value, returns ``None`` if the attribute does not exist. iN( RmR¤R¥RRtMXSymbolGetAttrRlR RnR§R R4(R8tkeyR¨R©((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pytattr's   . c@s„|rtdƒ‚ntƒ}tjtjƒƒ‰tj}t||jtj |ƒtj ˆƒƒƒ‡fd†t |j ƒDƒS(sEGets all attributes from the symbol. Example ------- >>> data = mx.sym.Variable('data', attr={'mood': 'angry'}) >>> data.list_attr() {'mood': 'angry'} Returns ------- ret : Dict of str to str A dictionary mapping attribute keys to values. sWSymbol.list_attr with recursive=True has been deprecated. Please use attr_dict instead.c@s9i|]/}tˆ|ddƒtˆ|dƒ“qS(ii(R (R;R9(tpairs(sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pys Zs ( tDeprecationWarningR RmtPOINTERR¤RtMXSymbolListAttrShallowRRlRnR™R§(R8t recursivetsizetf_handle((R­sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt list_attrEs  +c C@sØtƒ}tjtjƒƒ}tj}t||jtj|ƒtj|ƒƒƒi}xyt |j ƒD]h}t ||dƒj dƒ\}}t ||ddƒ}||krÂi||>> a = mx.sym.Variable('a', attr={'a1':'a2'}) >>> b = mx.sym.Variable('b', attr={'b1':'b2'}) >>> c = a+b >>> c.attr_dict() {'a': {'a1': 'a2'}, 'b': {'b1': 'b2'}} Returns ------- ret : Dict of str to dict There is a key in the returned dict for every child with non-empty attribute set. For each symbol, the name of the symbol is its key in the dict and the correspond value is that symbol's attribute list (itself a dictionary). it$i( R RmR¯R¤RtMXSymbolListAttrRRlRnR™R§R tsplit( R8R²R­R³R¨R9R3R«R“((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt attr_dict\s  +#  cK@smxf|jƒD]X\}}t|tƒs7tdƒ‚nttj|jt|ƒtt |ƒƒƒƒq WdS(sSets an attribute of the symbol. For example. A._set_attr(foo="bar") adds the mapping ``"{foo: bar}"`` to the symbol's attribute dictionary. Parameters ---------- **kwargs The attributes to set s#Set Attr only accepts string valuesN( titemsR?RR›RRtMXSymbolSetAttrRlR RC(R8RŠR«R§((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt _set_attr{s  cC@s8tƒ}ttj|jtj|ƒƒƒtd|ƒS(saGets a new grouped symbol `sgroup`. The output of `sgroup` is a list of outputs of all of the internal nodes. Consider the following code: Example ------- >>> a = mx.sym.var('a') >>> b = mx.sym.var('b') >>> c = a + b >>> d = c.get_internals() >>> d >>> d.list_outputs() ['a', 'b', '_plus4_output'] Returns ------- sgroup : Symbol A symbol group containing all internal and leaf nodes of the computation graph used to compute the symbol. Rl(RRRtMXSymbolGetInternalsRlRmRnR#(R8Rl((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt get_internalsŒs  cC@sZtƒ}ttj|jtj|ƒƒƒtd|ƒ}t|j ƒƒdkrVdS|S(s«Gets a new grouped symbol whose output contains inputs to output nodes of the original symbol. Example ------- >>> x = mx.sym.Variable('x') >>> y = mx.sym.Variable('y') >>> z = mx.sym.Variable('z') >>> a = y+z >>> b = x+a >>> b.get_children() >>> b.get_children().list_outputs() ['x', '_plus10_output'] >>> b.get_children().get_children().list_outputs() ['y', 'z'] Returns ------- sgroup : Symbol or None The children of the head node. If the symbol has no inputs then ``None`` will be returned. RliN( RRRtMXSymbolGetChildrenRlRmRnR#RŽR<R4(R8RlR¨((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt get_children¨s  cC@sytjƒ}tjtjƒƒ}ttj|jtj|ƒtj|ƒƒƒgt |j ƒD]}t ||ƒ^q_S(spLists all the arguments in the symbol. Example ------- >>> a = mx.sym.var('a') >>> b = mx.sym.var('b') >>> c = a + b >>> c.list_arguments ['a', 'b'] Returns ------- args : list of string List containing the names of all the arguments required to compute the symbol. ( Rmtc_uintR¯R¤RRtMXSymbolListArgumentsRlRnR™R§R (R8R²tsarrR9((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pytlist_argumentsÈs   %cC@sytjƒ}tjtjƒƒ}ttj|jtj|ƒtj|ƒƒƒgt |j ƒD]}t ||ƒ^q_S(sëLists all the outputs in the symbol. Example ------- >>> a = mx.sym.var('a') >>> b = mx.sym.var('b') >>> c = a + b >>> c.list_outputs() ['_plus12_output'] Returns ------- list of str List of all the outputs. For most symbols, this list contains only the name of this symbol. For symbol groups, this is a list with the names of all symbols in the group. ( RmRÀR¯R¤RRtMXSymbolListOutputsRlRnR™R§R (R8R²RÂR9((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR<Þs   %cC@s2tƒ}ttj|jtj|ƒƒƒ|jS(sGet number of outputs for the symbol. Example ------- >>> a = mx.sym.var('a') >>> b = mx.sym.var('b') >>> c = a + b >>> len(c) Returns ------- len(self): Number of outputs Number of outputs (R RRtMXSymbolGetNumOutputsRlRmRnR§(R8R ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt__len__øs "cC@sytjƒ}tjtjƒƒ}ttj|jtj|ƒtj|ƒƒƒgt |j ƒD]}t ||ƒ^q_S(sILists all the auxiliary states in the symbol. Example ------- >>> a = mx.sym.var('a') >>> b = mx.sym.var('b') >>> c = a + b >>> c.list_auxiliary_states() [] Example of auxiliary states in `BatchNorm`. >>> data = mx.symbol.Variable('data') >>> weight = mx.sym.Variable(name='fc1_weight') >>> fc1 = mx.symbol.FullyConnected(data = data, weight=weight, name='fc1', num_hidden=128) >>> fc2 = mx.symbol.BatchNorm(fc1, name='batchnorm0') >>> fc2.list_auxiliary_states() ['batchnorm0_moving_mean', 'batchnorm0_moving_var'] Returns ------- aux_states : list of str List of the auxiliary states in input symbol. Notes ----- Auxiliary states are special states of symbols that do not correspond to an argument, and are not updated by gradient descent. Common examples of auxiliary states include the `moving_mean` and `moving_variance` in `BatchNorm`. Most operators do not have auxiliary states. ( RmRÀR¯R¤RRtMXSymbolListAuxiliaryStatesRlRnR™R§R (R8R²RÂR9((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pytlist_auxiliary_states s  %cC@s|tjƒ}tjtjƒƒ}ttj|jdtj|ƒtj|ƒƒƒgt |j ƒD]}t ||ƒ^qbS(søLists all arguments and auxiliary states of this Symbol. Returns ------- inputs : list of str List of all inputs. Examples -------- >>> bn = mx.sym.BatchNorm(name='bn') >>> bn.list_arguments() ['bn_data', 'bn_gamma', 'bn_beta'] >>> bn.list_auxiliary_states() ['bn_moving_mean', 'bn_moving_var'] >>> bn.list_inputs() ['bn_data', 'bn_gamma', 'bn_beta', 'bn_moving_mean', 'bn_moving_var'] i( RmRÀR¯R¤RRtNNSymbolListInputNamesRlRnR™R§R (R8R²RÂR9((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt list_inputs1s   (cO@sßt|ƒdkr3t|ƒdkr3tdƒ‚ng}t|ƒdkrÕttjgƒ}xã|D]j}|dk rÁtj|ƒj}|t kr­t dt t ƒƒ‚n|j t |ƒqd|j dƒqdWnng}xY|j ƒD]K\}}tj|ƒj}|t krè|j |ƒ|j t |ƒqèqèWt|ƒ}tƒ} tjtjƒƒ} tƒ} tjtjƒƒ} tƒ} tjtjƒƒ}tjƒ}ttj|jtt|ƒƒ|ttjtd|ƒƒtj| ƒtj| ƒtj| ƒtj| ƒtj| ƒtj|ƒtj|ƒƒ ƒ|jdkr×gt| jƒD]}t| |^q\}gt| jƒD]}t| |^q†}gt| jƒD]}t||^q°}|||fSdSdS(s×Infers the type of all arguments and all outputs, given the known types for some arguments. This function takes the known types of some arguments in either positional way or keyword argument way as input. It returns a tuple of `None` values if there is not enough information to deduce the missing types. Inconsistencies in the known types will cause an error to be raised. Example ------- >>> a = mx.sym.var('a') >>> b = mx.sym.var('b') >>> c = a + b >>> arg_types, out_types, aux_types = c.infer_type(a='float32') >>> arg_types [, ] >>> out_types [] >>> aux_types [] Parameters ---------- *args : Type of known arguments in a positional way. Unknown type can be marked as None. **kwargs : Keyword arguments of known types. Returns ------- arg_types : list of numpy.dtype or None List of argument types. The order is same as the order of list_arguments(). out_types : list of numpy.dtype or None List of output types. The order is same as the order of list_outputs(). aux_types : list of numpy.dtype or None List of auxiliary state types. The order is same as the order of list_auxiliary_states(). is]Can only specify known argument types either by positional or kwargs way.sArgument need to be one of iÿÿÿÿR9N(NNN(RŽR›RRmR¤R4t_numpytdtypeRDRRBRCtappendR¹R R R¯R¥RRtMXSymbolInferTypeRlRRRnR§R™R(R8R‰RŠtsdataRR‹tstr_keystktvt arg_type_sizet arg_type_datat out_type_sizet out_type_datat aux_type_sizet aux_type_datatcompleteR9t arg_typest out_typest aux_types((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt infer_typeIsZ-$                  *** cO@szy|jt||Ž}|ddkrý|jt||Ž\}}}|jƒ}g}xwt||ƒD]f\}} | s‹tj| ƒ rht|ƒdkr®|j dƒPn|j d|t | ƒfƒqhqhWt j ddddj |ƒd d ƒn|SWnqtk rud GHx)t|ƒD]\} } d | | fGHq$Wx)|jƒD]\} } d | | fGHqPW‚nXdS(s8Infers the shapes of all arguments and all outputs given the known shapes of some arguments. This function takes the known shapes of some arguments in either positional way or keyword argument way as input. It returns a tuple of `None` values if there is not enough information to deduce the missing shapes. Example ------- >>> a = mx.sym.var('a') >>> b = mx.sym.var('b') >>> c = a + b >>> arg_shapes, out_shapes, aux_shapes = c.infer_shape(a=(3,3)) >>> arg_shapes [(3L, 3L), (3L, 3L)] >>> out_shapes [(3L, 3L)] >>> aux_shapes [] >>> c.infer_shape(a=(0,3)) # 0s in shape means unknown dimensions. So, returns None. (None, None, None) Inconsistencies in the known shapes will cause an error to be raised. See the following example: >>> data = mx.sym.Variable('data') >>> out = mx.sym.FullyConnected(data=data, name='fc1', num_hidden=1000) >>> out = mx.sym.Activation(data=out, act_type='relu') >>> out = mx.sym.FullyConnected(data=out, name='fc2', num_hidden=10) >>> weight_shape= (1, 100) >>> data_shape = (100, 100) >>> out.infer_shape(data=data_shape, fc1_weight=weight_shape) Error in operator fc1: Shape inconsistent, Provided=(1,100), inferred shape=(1000,100) Parameters ---------- *args : Shape of arguments in a positional way. Unknown shape can be marked as None. **kwargs : Keyword arguments of the known shapes. Returns ------- arg_shapes : list of tuple or None List of argument shapes. The order is same as the order of list_arguments(). out_shapes : list of tuple or None List of output shapes. The order is same as the order of list_outputs(). aux_shapes : list of tuple or None List of auxiliary state shapes. The order is same as the order of list_auxiliary_states(). ii s...s%s: %ss0Cannot decide shape for the following arguments s((0s in shape means unknown dimensions). s#Consider providing them as input: s t stacklevelisinfer_shape error. Arguments:s #%d: %ss %s: %sN(t_infer_shape_impltFalseR4tTrueRÃtzipRËtprodRŽRÍRCtwarningstwarnR5RRšR¹(R8R‰RŠtrest arg_shapesRot arg_namestunknownsR3tshapeR9R’RÑRÒ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt infer_shape«s.8  $  cO@s|jt||ŽS(s”Infers the shape partially. This functions works the same way as `infer_shape`, except that this function can return partial results. In the following example, information about fc2 is not available. So, `infer_shape` will return a tuple of `None` values but `infer_shape_partial` will return partial values. Example ------- >>> data = mx.sym.Variable('data') >>> prev = mx.sym.Variable('prev') >>> fc1 = mx.sym.FullyConnected(data=data, name='fc1', num_hidden=128) >>> fc2 = mx.sym.FullyConnected(data=prev, name='fc2', num_hidden=128) >>> out = mx.sym.Activation(data=mx.sym.elemwise_add(fc1, fc2), act_type='relu') >>> out.list_arguments() ['data', 'fc1_weight', 'fc1_bias', 'prev', 'fc2_weight', 'fc2_bias'] >>> out.infer_shape(data=(10,64)) (None, None, None) >>> out.infer_shape_partial(data=(10,64)) ([(10L, 64L), (128L, 64L), (128L,), (), (), ()], [(10L, 128L)], []) >>> # infers shape if you give information about fc2 >>> out.infer_shape(data=(10,64), prev=(10,128)) ([(10L, 64L), (128L, 64L), (128L,), (10L, 128L), (128L, 128L), (128L,)], [(10L, 128L)], []) Parameters ---------- *args : Shape of arguments in a positional way. Unknown shape can be marked as None **kwargs : Keyword arguments of known shapes. Returns ------- arg_shapes : list of tuple or None List of argument shapes. The order is same as the order of list_arguments(). out_shapes : list of tuple or None List of output shapes. The order is same as the order of list_outputs(). aux_shapes : list of tuple or None List of auxiliary state shapes. The order is same as the order of list_auxiliary_states(). (RßRá(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pytinfer_shape_partialýs/cO@sÁt|ƒdkr3t|ƒdkr3tdƒ‚ng}dg}t|ƒdkrãttjgƒ}xt|ƒD]i\}}|dk rÉt|tƒs¹t d|t |ƒfƒ‚n|j |ƒn|j t|ƒƒqsWnŠg} xu|j ƒD]g\} } t| tƒs0t d| t | ƒfƒ‚n| j | ƒ|j | ƒ|j t|ƒƒqöWt| ƒ}tƒ} tjtƒƒ} tjtjtƒƒƒ}tƒ}tjtƒƒ}tjtjtƒƒƒ}tƒ}tjtƒƒ}tjtjtƒƒƒ}tjƒ}|r-tj}n tj}t||jtt|ƒdƒ|tttd|ƒƒtttd|ƒƒtj| ƒtj| ƒtj|ƒtj|ƒtj|ƒtj|ƒtj|ƒtj|ƒtj|ƒtj|ƒƒƒ|jdkr¹gt| jƒD]}t||| | ƒ^q }gt|jƒD]}t|||| ƒ^qT}gt|jƒD]}t|||| ƒ^qˆ}|||fSdSdS( s:The actual implementation for calling shape inference API.is^Can only specify known argument shapes either by positional or kwargs way.s;Arguments need to be shapes (tuple), but argument %d is %s.s4Arguments need to be shapes (tuple), but '%s' is %s.itIN(NNN(RŽR›RRmR¤RšR4R?ttupleRBRDtextendRÍR¹R R R¯R¥RtMXSymbolInferShapePartialtMXSymbolInferShapeRRlRRRnR§R™(R8tpartialR‰RŠRÏtindptrRR9R‹RÐRÑRÒtarg_shape_sizetarg_shape_ndimtarg_shape_datatout_shape_sizetout_shape_ndimtout_shape_datataux_shape_sizetaux_shape_ndimtaux_shape_dataRÙt infer_funcRçt out_shapest aux_shapes((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRß.st$                     444 cC@s;tjƒ}ttj|jtj|ƒƒƒt|jƒS(s'Gets a debug string of symbol. It contains Symbol output, variables and operators in the computation graph with their inputs, variables and attributes. Returns ------- string Debug string of the symbol. Examples -------- >>> a = mx.sym.Variable('a') >>> b = mx.sym.sin(a) >>> c = 2 * a + b >>> d = mx.sym.FullyConnected(data=c, num_hidden=10) >>> d.debug_str() >>> print d.debug_str() Symbol Outputs: output[0]=fullyconnected0(0) Variable:a -------------------- Op:_mul_scalar, Name=_mulscalar0 Inputs: arg[0]=a(0) version=0 Attrs: scalar=2 -------------------- Op:sin, Name=sin0 Inputs: arg[0]=a(0) version=0 -------------------- Op:elemwise_add, Name=_plus0 Inputs: arg[0]=_mulscalar0(0) arg[1]=sin0(0) Variable:fullyconnected0_weight Variable:fullyconnected0_bias -------------------- Op:FullyConnected, Name=fullyconnected0 Inputs: arg[0]=_plus0(0) arg[1]=fullyconnected0_weight(0) version=0 arg[2]=fullyconnected0_bias(0) version=0 Attrs: num_hidden=10 ( RmR¤RRt MXSymbolPrintRlRnR R§(R8t debug_str((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRss0  cC@sAt|tƒstdƒ‚nttj|jt|ƒƒƒdS(sòSaves symbol to a file. You can also use pickle to do the job if you only work on python. The advantage of `load`/`save` functions is that the file contents are language agnostic. This means the model saved by one language binding can be loaded by a different language binding of `MXNet`. You also get the benefit of being able to directly load/save from cloud storage(S3, HDFS). Parameters ---------- fname : str The name of the file. - "s3://my-bucket/path/my-s3-symbol" - "hdfs://my-bucket/path/my-hdfs-symbol" - "/path-to/my-local-symbol" See Also -------- symbol.load : Used to load symbol from file. sfname need to be stringN(R?RRBRRtMXSymbolSaveToFileRlR (R8tfname((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pytsave¨scC@s;tjƒ}ttj|jtj|ƒƒƒt|jƒS(s‹Saves symbol to a JSON string. See Also -------- symbol.load_json : Used to load symbol from JSON string. ( RmR¤RRtMXSymbolSaveToJSONRlRnR R§(R8R†((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR‚Âs "cC@sg}g}t|tƒr°t|ƒt|ƒkrFtd|ƒ‚nx^|D]V}|dkru|ru|jdƒqMt|tƒs“tdƒ‚qM|j|jƒqMW|}n¼t|t ƒr`xª|D]“}||kr ||}t|tƒstdƒ‚n|j|jƒ|j|ƒqÆ|rC|jdƒ|jdƒqÆtd||fƒ‚qÆWn tdƒ‚t t |ƒ|fS(snHelper function to get NDArray lists handles from various inputs. Parameters ---------- arg_key : str The name of argument, used for error message. args : list of NDArray or dict of str to NDArray Input arguments to the symbols. If type is list of NDArray, the position is in the same order of arg_names. If type is dict of str to NDArray, then it maps the name of arguments to the corresponding NDArray, args_names : list of string List of argument names. allow_missing : boolean Whether missing argument is allowed. When allowed, the missing handle will be set to None(null) Returns ------- handles : list of NDArrayHandle The positional list of NDArrayHandles generated from input. s3Length of %s does not match the number of argumentss6Only accept list of NDArrays or dict of str to NDArrayskey `%s` is missing in `%s`N( R?tlistRŽR›R4RÍRRBRltdictRR(targ_keyR‰Rèt allow_missingt arg_handlest arg_arraystnarrR3((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt_get_ndarray_inputsÍs4       twritec 4%K@sâd} tjtjƒƒ} tjtƒƒ} |dk rÝg} g} xY|jƒD]K\} }tj|ƒj}|t krR| j | ƒ| j t |ƒqRqRWtt | ƒƒ} t | ƒ} t tjtd| ƒƒ} nd}tjtjƒƒ}tjtƒƒ}|dk r¨g}g}xG|jƒD]9\} }|tkr/|j | ƒ|j t|ƒq/q/Wtt |ƒƒ}t |ƒ}t tjtd|ƒƒ}ng}dg}g}xY| jƒD]K\} }t|tƒrÊ|j | ƒ|j|ƒ|j t |ƒƒqÊqÊWd}tjtjƒƒ}tjtjƒƒ}|dk rXt|tƒrvd}|g}nÓt|tƒr»t |ƒdkr¦tdƒ‚n|}t |ƒ}nŽt|tƒrIt |ƒdkrëtdƒ‚ng}g}x4|jƒD]&\} }|j | ƒ|j |ƒqWt |ƒ}t |ƒ}nt |ƒ}ntdƒ}tjtjƒƒ}tjtjƒƒ}tjtjƒƒ}|dk rbg}g}g}xG|jƒD]9\}}|j |ƒ|j |jƒ|j |jƒqÎWtt |ƒƒ}t |ƒ}ttjtd|ƒƒ}ttjtd|ƒƒ}ng}|dk r›t|tƒs’tdƒ‚n|}n|dkràtjdƒ}tjtjƒƒ} tjtƒƒ}!nt|tƒsþtdƒ‚n|jƒ}"|jƒ}#x)|#D]!}|jdkst d ƒ‚qWt |"ƒ} tjt |#ƒƒ}t!|#ƒ}!tjtjƒƒ}$tjtƒƒ}%|dk r«|j"nt#ƒ}&t#ƒ}'tj$ƒ}(tjtƒƒ})tjtƒƒ}*tj$ƒ}+tjtƒƒ},y4t%t&j'|j"tj|jƒtj|jƒ||||t|ƒ||tt |ƒƒt |ƒt ttd |ƒƒt ttd |ƒƒ| | | |||tt |ƒƒt |ƒtj(|ƒ| |!tj(|$ƒtj(|%ƒtj(|(ƒtj(|)ƒtj(|*ƒtj(|+ƒtj(|,ƒ|&tj(|'ƒƒ"ƒWndt)k r¥}-d }.x.| jƒD] \} }|.d | |f7}.qdW|.d |-7}.t|.ƒ‚nX|dk rÿxJt*|j+ƒD]6}/t,|$|/ƒ} t-t|%|/ƒƒ}||| >> x = mx.sym.Variable('x') >>> y = mx.sym.FullyConnected(x, num_hidden=4) >>> exe = y.simple_bind(mx.cpu(), x=(5,4), grad_req='null') >>> exe.forward() [] >>> exe.outputs[0].asnumpy() array([[ 0., 0., 0., 0.], [ 0., 0., 0., 0.], [ 0., 0., 0., 0.], [ 0., 0., 0., 0.], [ 0., 0., 0., 0.]], dtype=float32) >>> exe.arg_arrays [, , ] >>> exe.grad_arrays [, , ] Parameters ---------- ctx : Context The device context the generated executor to run on. grad_req: string {'write', 'add', 'null'}, or list of str or dict of str to str, optional To specify how we should update the gradient to the `args_grad`. - 'write' means every time gradient is written to specified `args_grad` NDArray. - 'add' means every time gradient is added to the specified NDArray. - 'null' means no action is taken, the gradient may not be calculated. type_dict : Dict of str->numpy.dtype Input type dictionary, name->dtype stype_dict : Dict of str->str Input storage type dictionary, name->storage_type group2ctx : Dict of string to mx.Context The dict mapping the `ctx_group` attribute to the context assignment. shared_arg_names : List of string The argument names whose `NDArray` of shared_exec can be reused for initializing the current executor. shared_exec : Executor The executor whose arg_arrays, arg_arrays, grad_arrays, and aux_arrays can be reused for initializing the current executor. shared_buffer : Dict of string to `NDArray` The dict mapping argument names to the `NDArray` that can be reused for initializing the current executor. This buffer will be checked for reuse if one argument name of the current executor is not found in `shared_arg_names`. The `NDArray`s are expected have default storage type. kwargs : Dict of str->shape Input shape dictionary, name->shape Returns ------- executor : mxnet.Executor The generated executor iR9s/grad_req in simple_bind cannot be an empty lists/grad_req in simple_bind cannot be an empty dicts6shared_arg_names in simple_bind must be a list or Noneiÿÿÿÿs1shared_buffer in simple_bind must be dict or NonetdefaultsGshared_buffer is expected to only contain NDArrays with default storageRíssimple_bind error. Arguments: s%s: %s s%sN(3RmR¯R¤R R4R¹RËRÌRDRRÍRŽR RR¥RRR?RîRïRRt RuntimeErrorRt device_typeidt device_idRR›RRRtstypetAssertionErrorR RlRRÀRRtMXExecutorSimpleBindRnRR™R§R RRRR t grad_arrayst aux_arrays(4R8tctxtgrad_reqt type_dictt stype_dictt group2ctxtshared_arg_namest shared_exect shared_bufferRŠtnum_provided_arg_typestprovided_arg_type_namestprovided_arg_type_dataRÑRÒtnum_provided_arg_stypestprovided_arg_stype_namestprovided_arg_stype_datatprovided_arg_shape_datatprovided_arg_shape_idxtprovided_arg_shape_namestprovided_req_type_list_lentprovided_grad_req_typestprovided_grad_req_namestnum_ctx_map_keyst ctx_map_keystctx_map_dev_typestctx_map_dev_idsR«R“tshared_arg_name_listtshared_buffer_lentshared_buffer_namestshared_buffer_handlest buffer_namest buffer_arraystupdated_shared_buffer_namestupdated_shared_buffer_handlestshared_exec_handlet exe_handlet num_in_argstin_arg_handlestarg_grad_handlestnum_aux_statestaux_state_handlestet error_msgR9R RRtexecutor((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyt simple_bind sBI                                           /E/   cC@sUt|tƒstdƒ‚n|jƒ}|jd||tƒ\} }|d krsttd gt |ƒƒ} n|jd||t ƒ\} }|d kr¦g}n|jd||j ƒtƒ\} }t|t ƒr*|t krþtdtt ƒƒ‚ntttdt |gt |ƒƒƒ} n³t|tƒrktttdg|D]} t | ^qLƒƒ} nrt|tƒrÝg}x?|D]7}||kr±|jt ||ƒq‡|jdƒq‡Wtttd|ƒƒ} ng}g}g}|rBxJ|jƒD]9\}}|j|ƒ|j|jƒ|j|jƒqWntƒ}|d k r`|jntƒ}ttj|jtj|jƒtj|jƒtt |ƒƒt |ƒttjtd|ƒƒttjtd|ƒƒtt |ƒƒ| | | tt |ƒƒ| |tj!|ƒƒƒt"|||||ƒ}||_#||_$||_%|S( s®Binds the current symbol to an executor and returns it. We first declare the computation and then bind to the data to run. This function returns an executor which provides method `forward()` method for evaluation and a `outputs()` method to get all the results. Example ------- >>> a = mx.sym.Variable('a') >>> b = mx.sym.Variable('b') >>> c = a + b >>> ex = c.bind(ctx=mx.cpu(), args={'a' : mx.nd.ones([2,3]), 'b' : mx.nd.ones([2,3])}) >>> ex.forward() [] >>> ex.outputs[0].asnumpy() [[ 2. 2. 2.] [ 2. 2. 2.]] Parameters ---------- ctx : Context The device context the generated executor to run on. args : list of NDArray or dict of str to NDArray Input arguments to the symbol. - If the input type is a list of `NDArray`, the order should be same as the order of `list_arguments()`. - If the input type is a dict of str to `NDArray`, then it maps the name of arguments to the corresponding `NDArray`. - In either case, all the arguments must be provided. args_grad : list of NDArray or dict of str to `NDArray`, optional When specified, `args_grad` provides NDArrays to hold the result of gradient value in backward. - If the input type is a list of `NDArray`, the order should be same as the order of `list_arguments()`. - If the input type is a dict of str to `NDArray`, then it maps the name of arguments to the corresponding NDArray. - When the type is a dict of str to `NDArray`, one only need to provide the dict for required argument gradient. Only the specified argument gradient will be calculated. grad_req : {'write', 'add', 'null'}, or list of str or dict of str to str, optional To specify how we should update the gradient to the `args_grad`. - 'write' means everytime gradient is write to specified `args_grad` `NDArray`. - 'add' means everytime gradient is add to the specified NDArray. - 'null' means no action is taken, the gradient may not be calculated. aux_states : list of `NDArray`, or dict of str to `NDArray`, optional Input auxiliary states to the symbol, only needed when the output of `list_auxiliary_states()` is not empty. - If the input type is a list of `NDArray`, the order should be same as the order of `list_auxiliary_states()`. - If the input type is a dict of str to `NDArray`, then it maps the name of `auxiliary_states` to the corresponding `NDArray`, - In either case, all the auxiliary states need to be provided. group2ctx : Dict of string to mx.Context The dict mapping the `ctx_group` attribute to the context assignment. shared_exec : mx.executor.Executor Executor to share memory with. This is intended for runtime reshaping, variable length sequences, etc. The returned executor shares state with `shared_exec`, and should not be used in parallel with it. Returns ------- executor : Executor The generated executor Notes ----- Auxiliary states are the special states of symbols that do not correspond to an argument, and do not have gradient but are still useful for the specific operations. Common examples of auxiliary states include the `moving_mean` and `moving_variance` states in `BatchNorm`. Most operators do not have auxiliary states and in those cases, this parameter can be safely ignored. One can give up gradient by using a dict in `args_grad` and only specify gradient they interested in. sContext type errorR‰t args_gradt aux_statessgrad_req must be in %sRíiR9N(&R?RRBRÃR RàR4RRRŽRáRÈRRR›RCRR RRRRÍR¹RRRRlRRtMXExecutorBindEXRmR¥R RnRR RR(R8RR‰RCRRDRRtlisted_argumentst args_handletargs_grad_handletaux_args_handlet reqs_arraytitemt req_arrayR3R-R.R/R«R“Rlt shared_handleRA((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pytbindsrZ     &,        cC@sStƒ}t|ƒ}ttj|jtt|ƒƒ|tj |ƒƒƒt |ƒS(sÎGets the autodiff of current symbol. This function can only be used if current symbol is a loss function. .. note:: This function is currently not implemented. Parameters ---------- wrt : Array of String keyword arguments of the symbol that the gradients are taken. Returns ------- grad : Symbol A gradient Symbol with returns to be the corresponding gradients. ( RR RRt MXSymbolGradRlR RŽRmRnR#(R8twrtRltc_wrt((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pytgradient¯s  cK@s.|dkrtƒ}n|j||ƒjƒS(s;Evaluates a symbol given arguments. The `eval` method combines a call to `bind` (which returns an executor) with a call to `forward` (executor method). For the common use case, where you might repeatedly evaluate with same arguments, eval is slow. In that case, you should call `bind` once and then repeatedly call forward. This function allows simpler syntax for less cumbersome introspection. Example ------- >>> a = mx.sym.Variable('a') >>> b = mx.sym.Variable('b') >>> c = a + b >>> ex = c.eval(ctx = mx.cpu(), a = mx.nd.ones([2,3]), b = mx.nd.ones([2,3])) >>> ex [] >>> ex[0].asnumpy() array([[ 2., 2., 2.], [ 2., 2., 2.]], dtype=float32) Parameters ---------- ctx : Context The device context the generated executor to run on. kwargs : Keyword arguments of type `NDArray` Input arguments to the symbol. All the arguments must be provided. Returns ---------- result : a list of NDArrays corresponding to the values taken by each symbol when evaluated on given args. When called on a single symbol (not a group), the result will be a list with one element. N(R4RRNtforward(R8RRŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pytevalÊs$  cO@stj|||ŽS(sšConvenience fluent method for :py:func:`reshape`. The arguments are the same as for :py:func:`reshape`, with this array as data. (R treshape(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRUòscO@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. (R t reshape_like(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRVúscO@stj|||ŽS(s”Convenience fluent method for :py:func:`cast`. The arguments are the same as for :py:func:`cast`, with this array as data. (R tcast(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pytastypescO@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. (R t zeros_like(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRY 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. (R t ones_like(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRZscO@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. (R tbroadcast_axes(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.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. (R trepeat(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR\"scO@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. (R tpad(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.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. (R tswapaxes(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR^2scO@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. (R R·(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR·:scO@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. (R R(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRBscO@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. (R t slice_axis(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR_JscO@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. (R t slice_like(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR`RscO@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. (R ttake(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRaZscO@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. (R tone_hot(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRbbscO@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. (R tpick(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRcjscO@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. (R tsort(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRdrscO@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. (R ttopk(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRezscO@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. (R targsort(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRf‚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. (R targmax(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRgŠ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. (R targmax_channel(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRh’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. (R targmin(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRiš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. (R tclip(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRj¢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. (R tabs(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRkª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. (R tsign(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRl²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. (R tflatten(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRmºscO@stj|||ŽS(sŸConvenience fluent method for :py:func:`shape_array`. The arguments are the same as for :py:func:`shape_op`, with this array as data. (R t shape_array(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRnÂ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. (R t size_array(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRoÊ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. (R t expand_dims(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRpÒscO@stj|||ŽS(s¤Convenience fluent method for :py:func:`broadcast_to`. The arguments are the same as for :py:func:`broadcast_to`, with this array as data. (R t broadcast_to(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRqÚscO@stj|||ŽS(s¨Convenience fluent method for :py:func:`broadcast_like`. The arguments are the same as for :py:func:`broadcast_like`, with this array as data. (R tbroadcast_like(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRrâ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. (R ttile(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRsê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. (R t transpose(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRtò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. (R tflip(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRuú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. (R tdepth_to_space(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRvscO@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. (R tspace_to_depth(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRw 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. (R tdiag(R8RÑRŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRxscO@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. (R tsum(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRyscO@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. (R tnansum(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRz"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. (R Rã(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.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. (R tnanprod(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR{2scO@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. (R tmean(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.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. (R tmax(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR}BscO@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. (R tmin(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR~JscO@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. (R tnorm(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRRscO@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. (R tround(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR€ZscO@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. (R trint(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRbscO@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. (R tfix(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR‚jscO@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. (R tfloor(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRƒrscO@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. (R tceil(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR„zscO@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. (R ttrunc(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR…‚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. (R tsin(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR†Š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. (R tcos(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR‡’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. (R ttan(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRˆš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. (R tarcsin(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR‰¢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. (R tarccos(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRŠª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. (R tarctan(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR‹²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. (R tdegrees(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.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. (R tradians(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.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. (R tsinh(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.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. (R tcosh(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.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. (R ttanh(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.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. (R tarcsinh(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.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. (R tarccosh(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.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. (R tarctanh(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR“ò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. (R texp(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR”ú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. (R texpm1(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.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. (R tlog(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.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. (R tlog10(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR— 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. (R tlog2(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.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. (R tlog1p(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR™" 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. (R tsqrt(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRš* scO@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. (R trsqrt(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR›2 scO@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. (R tcbrt(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRœ: 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. (R trcbrt(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRB scO@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. (R tsquare(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRžJ 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. (R t reciprocal(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRŸR 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. (R trelu(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR Z 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. (R tsigmoid(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR¡b 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. (R tsoftmax(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR¢j 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. (R t log_softmax(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR£r 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. (R tsoftmin(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR¤z 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. (R tsqueeze(R8R‰RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR¥‚ scC@s>tƒ}ttj|jt|ƒtj|ƒƒƒt|ƒS(sïReturn symbol for target backend. Parameters ---------- backend : str The backend names. Returns ------- out : Symbol The created Symbol for target backend. ( RRRtMXGenBackendSubgraphRlR RmRnR#(R8tbackendtout((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pytget_backend_symbolŠ s +cC@st|jdƒ‚dS(N(Rt wait_to_readR4(R8((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyRª› scC@st|jdƒ‚dS(N(RtasnumpyR4(R8((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR«ž scC@st|jdƒ‚dS(N(RtasscalarR4(R8((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR¬¡ scC@st|jdƒ‚dS(N(RtcopyR4(R8((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR­¤ scC@st|jdƒ‚dS(N(Rt as_in_contextR4(R8((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR®§ scC@st|jdƒ‚dS(N(RtdetachR4(R8((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR¯ª scC@st|jdƒ‚dS(N(RtbackwardR4(R8((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR°­ s(¡R7t __module__t__doc__t __slots__t__array_priority__R:R=RFRHt __nonzero__RIRJRMRNRPRSRTRURXRZR]R_R`RaRbRcRfRgRhRjRiRrRuRxR{R~RRƒR‡RŒRˆR£tpropertyR3R¬RàR´R¸R»R½R¿RÃR<RÆRÈRÊRÝRëRìRßRRR‚t staticmethodR R4RBRNRRRTRURVRXRYRZR[R\R]R^R·RR_R`RaRbRcRdReRfRgRhRiRjRkRlRmRnRoRpRqRrRsRtRuRvRwRxRyRzRãR{R|R}R~RR€RR‚RƒR„R…R†R‡RˆR‰RŠR‹RŒRRŽRRR‘R’R“R”R•R–R—R˜R™RšR›RœRRžRŸR R¡R¢R£R¤R¥R©RªR«R¬R­R®R¯R°(((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR#6s>                    $ 7 1         &  b R 1 E 5  <   ÿ  (                                                                                          c K@sþt|tƒstdƒ‚ntƒ} ttjt|ƒtj | ƒƒƒt | ƒ} t t j dƒs|t ƒt j _nt j jj|ƒ}|d kr£in|}|d k rÈt|ƒ|d>> data = mx.sym.Variable('data', attr={'a': 'b'}) >>> data >>> csr_data = mx.sym.Variable('csr_data', stype='csr') >>> csr_data >>> row_sparse_weight = mx.sym.Variable('weight', stype='row_sparse') >>> row_sparse_weight Parameters ---------- name : str Variable name. attr : Dict of strings Additional attributes to set on the variable. Format {string : string}. shape : tuple The shape of a variable. If specified, this will be used during the shape inference. If one has specified a different shape for this variable using a keyword argument when calling shape inference, this shape information will be ignored. lr_mult : float The learning rate multiplier for input variable. wd_mult : float Weight decay multiplier for input variable. dtype : str or numpy.dtype The dtype for input variable. If not specified, this value will be inferred. init : initializer (mxnet.init.*) Initializer for this variable to (optionally) override the default initializer. stype : str The storage type of the variable, such as 'row_sparse', 'csr', 'default', etc kwargs : Additional attribute variables Additional attributes must start and end with double underscores. Returns ------- variable : Symbol A symbol corresponding to an input to the computation graph. s#Expect a string for variable `name`R§t __shape__t __lr_mult__t __wd_mult__t __dtype__t__init__t__storage_type__t__swAttribute name=%s is not supported. Additional attributes must start and end with double underscores, e.g, __yourattr__N(R?RRBRRRtMXSymbolCreateVariableR RmRnR#thasattrRt_currentR§tgetR4RCRRËRÌRDtdumpsRR¹t startswithtendswithR›R»( R3R¬Rêtlr_multtwd_multRÌtinitRRŠRlR¨RÑRÒ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR$° s<, %     #    cC@ss| std„|Dƒƒr,tdƒ‚ntƒ}ttjtt|ƒƒt|ƒt j |ƒƒƒt |ƒS(s|Creates a symbol that contains a collection of other symbols, grouped together. Example ------- >>> a = mx.sym.Variable('a') >>> b = mx.sym.Variable('b') >>> mx.sym.Group([a,b]) Parameters ---------- symbols : list List of symbols to be grouped. Returns ------- sym : Symbol A group symbol. cs@s|]}t|tƒ VqdS(N(R?R#(R;tsym((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pys  ss#Expected a list of symbols as input( tanyRBRRRtMXSymbolCreateGroupR RŽR RmRnR#(tsymbolsRl((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR& s  cC@sVt|tƒstdƒ‚ntƒ}ttjt|ƒtj |ƒƒƒt |ƒS(sÎLoads symbol from a JSON file. You can also use pickle to do the job if you only work on python. The advantage of load/save is the file is language agnostic. This means the file saved using save can be loaded by other language binding of mxnet. You also get the benefit being able to directly load/save from cloud storage(S3, HDFS). Parameters ---------- fname : str The name of the file, examples: - `s3://my-bucket/path/my-s3-symbol` - `hdfs://my-bucket/path/my-hdfs-symbol` - `/path-to/my-local-symbol` Returns ------- sym : Symbol The loaded symbol. See Also -------- Symbol.save : Used to save symbol into file. sfname need to be string( R?RRBRRRtMXSymbolCreateFromFileR RmRnR#(RRl((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR' s  %cC@sVt|tƒstdƒ‚ntƒ}ttjt|ƒtj |ƒƒƒt |ƒS(sLoads symbol from json string. Parameters ---------- json_str : str A JSON string. Returns ------- sym : Symbol The loaded symbol. See Also -------- Symbol.tojson : Used to save symbol into json string. sfname required to be string( R?RRBRRRR„R RmRnR#(R†Rl((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR(@ s  %cC@sèt|tƒr.t|tƒr.tj||ƒSt|tƒr_t|tƒr_tj|d|ƒSt|tƒrt|tƒrtj|d|ƒSt|tƒr¶t|tƒr¶||Stdtt |ƒƒtt |ƒƒfƒ‚dS(s¢Returns element-wise result of base element raised to powers from exp element. Both inputs can be Symbol or scalar number. Broadcasting is not supported. Use `broadcast_pow` instead. Parameters --------- base : Symbol or scalar The base symbol exp : Symbol or scalar The exponent symbol Returns ------- Symbol or scalar The bases in x raised to the exponents in y. Examples -------- >>> mx.sym.pow(2, 3) 8 >>> x = mx.sym.Variable('x') >>> y = mx.sym.Variable('y') >>> z = mx.sym.pow(x, 2) >>> z.eval(x=mx.nd.array([1,2]))[0].asnumpy() array([ 1., 4.], dtype=float32) >>> z = mx.sym.pow(3, y) >>> z.eval(y=mx.nd.array([2,3]))[0].asnumpy() array([ 9., 27.], dtype=float32) >>> z = mx.sym.pow(x, y) >>> z.eval(x=mx.nd.array([3,4]), y=mx.nd.array([2,3]))[0].asnumpy() array([ 9., 64.], dtype=float32) R>stypes (%s, %s) not supportedN( R?R#RRdRRet _RPowerScalarRBRCRD(tbaseR”((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR)Z s"cC@sôt|tƒr.t|tƒr.tj||ƒSt|tƒr_t|tƒr_tj|d|ƒSt|tƒrt|tƒrtj|d|ƒSt|tƒrÂt|tƒrÂ||kr¾|S|Stdtt|ƒƒtt|ƒƒfƒ‚dS(s/Returns element-wise maximum of the input elements. Both inputs can be Symbol or scalar number. Broadcasting is not supported. Parameters --------- left : Symbol or scalar First symbol to be compared. right : Symbol or scalar Second symbol to be compared. Returns ------- Symbol or scalar The element-wise maximum of the input symbols. Examples -------- >>> mx.sym.maximum(2, 3.5) 3.5 >>> x = mx.sym.Variable('x') >>> y = mx.sym.Variable('y') >>> z = mx.sym.maximum(x, 4) >>> z.eval(x=mx.nd.array([3,5,2,10]))[0].asnumpy() array([ 4., 5., 4., 10.], dtype=float32) >>> z = mx.sym.maximum(x, y) >>> z.eval(x=mx.nd.array([3,4]), y=mx.nd.array([10,2]))[0].asnumpy() array([ 10., 4.], dtype=float32) R>stypes (%s, %s) not supportedN( R?R#Rt_MaximumRt_MaximumScalarRBRCRD(tlefttright((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR*Š scC@sôt|tƒr.t|tƒr.tj||ƒSt|tƒr_t|tƒr_tj|d|ƒSt|tƒrt|tƒrtj|d|ƒSt|tƒrÂt|tƒrÂ||kr¾|S|Stdtt|ƒƒtt|ƒƒfƒ‚dS(s'Returns element-wise minimum of the input elements. Both inputs can be Symbol or scalar number. Broadcasting is not supported. Parameters --------- left : Symbol or scalar First symbol to be compared. right : Symbol or scalar Second symbol to be compared. Returns ------- Symbol or scalar The element-wise minimum of the input symbols. Examples -------- >>> mx.sym.minimum(2, 3.5) 2 >>> x = mx.sym.Variable('x') >>> y = mx.sym.Variable('y') >>> z = mx.sym.minimum(x, 4) >>> z.eval(x=mx.nd.array([3,5,2,10]))[0].asnumpy() array([ 3., 4., 2., 4.], dtype=float32) >>> z = mx.sym.minimum(x, y) >>> z.eval(x=mx.nd.array([3,4]), y=mx.nd.array([10,2]))[0].asnumpy() array([ 3., 2.], dtype=float32) R>stypes (%s, %s) not supportedN( R?R#Rt_MinimumRt_MinimumScalarRBRCRD(RÒRÓ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR+¶ scC@sðt|tƒr.t|tƒr.tj||ƒSt|tƒr_t|tƒr_tj|d|ƒSt|tƒrt|tƒrtj|d|ƒSt|tƒr¾t|tƒr¾tj||ƒStdt t |ƒƒt t |ƒƒfƒ‚dS(s{Given the "legs" of a right triangle, returns its hypotenuse. Equivalent to :math:`\sqrt(left^2 + right^2)`, element-wise. Both inputs can be Symbol or scalar number. Broadcasting is not supported. Parameters --------- left : Symbol or scalar First leg of the triangle(s). right : Symbol or scalar Second leg of the triangle(s). Returns ------- Symbol or scalar The hypotenuse of the triangle(s) Examples -------- >>> mx.sym.hypot(3, 4) 5.0 >>> x = mx.sym.Variable('x') >>> y = mx.sym.Variable('y') >>> z = mx.sym.hypot(x, 4) >>> z.eval(x=mx.nd.array([3,5,2]))[0].asnumpy() array([ 5., 6.40312433, 4.47213602], dtype=float32) >>> z = mx.sym.hypot(x, y) >>> z.eval(x=mx.nd.array([3,4]), y=mx.nd.array([10,2]))[0].asnumpy() array([ 10.44030666, 4.47213602], dtype=float32) R>stypes (%s, %s) not supportedN( R?R#Rt_HypotRt _HypotScalarRËR,RBRCRD(RÒRÓ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR,â scK@s4|dkrtj}ntj|||d||S(s~Returns a new symbol of 2-D shpae, filled 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. dtype : str or numpy.dtype, optional The value type of the inner value, default to ``np.float32``. Returns ------- out : Symbol The created Symbol. RÌN(R4RËtfloat32Rt_eye(tNtMRÑRÌRŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR- s  cK@s1|dkrtj}ntjd|d||S(s^Returns a new symbol of given shape and type, filled with zeros. Parameters ---------- shape : int or sequence of ints Shape of the new array. dtype : str or numpy.dtype, optional The value type of the inner value, default to ``np.float32``. Returns ------- out : Symbol The created Symbol. RêRÌN(R4RËRØRt_zeros(RêRÌRŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR.% s  cK@s1|dkrtj}ntjd|d||S(s\Returns a new symbol of given shape and type, filled with ones. Parameters ---------- shape : int or sequence of ints Shape of the new array. dtype : str or numpy.dtype, optional The value type of the inner value, default to ``np.float32``. Returns ------- out : Symbol The created Symbol RêRÌN(R4RËRØRt_ones(RêRÌRŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR/9 s  cK@s=|dkrtj}ntjd|d|dt|ƒ|S(s‘Returns a new array of given shape and type, filled with the given value `val`. Parameters ---------- shape : int or sequence of ints Shape of the new array. val : scalar Fill value. dtype : str or numpy.dtype, optional The value type of the inner value, default to ``np.float32``. Returns ------- out : Symbol The created Symbol RêRÌR§N(R4RËRØRt_fulltfloat(RêR“RÌRŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR0M s  gð?cC@sL|dkrtj}ntjd|d|d|d|d|d|d|ƒS( s¬Returns evenly spaced values within a given interval. Parameters ---------- start : number Start of interval. The interval includes this value. The default start value is 0. stop : number, optional End of interval. The interval does not include this value. step : number, optional Spacing between values. repeat : int, optional "The repeating time of all elements. E.g repeat=3, the element a will be repeated three times --> a, a, a. dtype : str or numpy.dtype, optional The value type of the inner value, default to ``np.float32``. Returns ------- out : Symbol The created Symbol R–R—R˜R\t infer_rangeR3RÌN(R4RËRØRt_arange(R–R—R˜R\RàR3RÌ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR1c s  !i cK@st|tƒr(tjd|d||St|tƒrq|dkrRtdƒ‚ntjd|d|d||Stdƒ‚dS(sLCompute 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), required if bins is an integer 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. tdatatbinss*null range is not supported in symbol modetbin_cntR™s7bins argument should be either an integer or an NDArrayN(R?R#Rt _histogramRR4R›(taRãR™RŠ((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pyR2~ s (IR²t __future__Rt_abst __builtin__RR•t ImportErrortbuiltinsRRmRätnumbersRtnumpyRËt attributeRRÏRRRRR R R R R RRRRRRRRtcontextRRtndarrayRRRRtndarray.ndarrayRRRARtRR R!R"t__all__R#R4R$R%R&R'R(R)R*R+R,R-R.R/R0RàR1R2(((sS/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/symbol/symbol.pytsj    4"" ÿÿÿÿÿÿÿÿÿƒN  !  0 , , *