ó —Àv]c@s;dZdddddgZddlmZddlZddlZd d lmZm Z d d l m Z m Z m Z mZd d lmZmZd d l mZddlmZmZmZd dl mZe je jfZde fd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdS(sNeural network parameter.tDeferredInitializationErrort ParametertConstantt ParameterDictt tensor_typesiÿÿÿÿ(t OrderedDictNi(t mx_real_tt MXNetError(tsymboltndarrayt initializertcontext(tContexttcpu(tautogradi(t_indentt_brief_print_listtshape_is_known(t is_np_shapecBseZdZRS(s-Error for unfinished deferred initialization.(t__name__t __module__t__doc__(((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR(sc Bs|eZdZdd"eddd"eeddd„ Zd„Ze d„ƒZ e j d„ƒZ e d„ƒZ e j d „ƒZ e d „ƒZ e j d „ƒZ d „Zd „Zd„Zedd„Zd„Zd„Zd„Zd„Zd"d"ejƒed„Zd„Zd„Zd„Zd„Zd"d„Zd„Zd"d„Zd„Z d„Z!d„Z"d „Z#d!„Z$RS(#se A Container holding parameters (weights) of Blocks. :py:class:`Parameter` holds a copy of the parameter on each :py:class:`Context` after it is initialized with ``Parameter.initialize(...)``. If :py:attr:`grad_req` is not ``'null'``, it will also hold a gradient array on each :py:class:`Context`:: ctx = mx.gpu(0) x = mx.nd.zeros((16, 100), ctx=ctx) w = mx.gluon.Parameter('fc_weight', shape=(64, 100), init=mx.init.Xavier()) b = mx.gluon.Parameter('fc_bias', shape=(64,), init=mx.init.Zero()) w.initialize(ctx=ctx) b.initialize(ctx=ctx) out = mx.nd.FullyConnected(x, w.data(ctx), b.data(ctx), num_hidden=64) Parameters ---------- name : str Name of this parameter. grad_req : {'write', 'add', 'null'}, default 'write' Specifies how to update gradient to grad arrays. - ``'write'`` means everytime gradient is written to grad :py:class:`NDArray`. - ``'add'`` means everytime gradient is added to the grad :py:class:`NDArray`. You need to manually call ``zero_grad()`` to clear the gradient buffer before each iteration when using this option. - 'null' means gradient is not requested for this parameter. gradient arrays will not be allocated. shape : int or tuple of int, default None Shape of this parameter. By default shape is not specified. Parameter with unknown shape can be used for :py:class:`Symbol` API, but ``init`` will throw an error when using :py:class:`NDArray` API. dtype : numpy.dtype or str, default 'float32' Data type of this parameter. For example, ``numpy.float32`` or ``'float32'``. lr_mult : float, default 1.0 Learning rate multiplier. Learning rate will be multiplied by lr_mult when updating this parameter with optimizer. wd_mult : float, default 1.0 Weight decay multiplier (L2 regularizer coefficient). Works similar to lr_mult. init : Initializer, default None Initializer of this parameter. Will use the global initializer by default. stype: {'default', 'row_sparse', 'csr'}, defaults to 'default'. The storage type of the parameter. grad_stype: {'default', 'row_sparse', 'csr'}, defaults to 'default'. The storage type of the parameter's gradient. Attributes ---------- grad_req : {'write', 'add', 'null'} This can be set before or after initialization. Setting ``grad_req`` to ``'null'`` with ``x.grad_req = 'null'`` saves memory and computation when you don't need gradient w.r.t x. lr_mult : float Local learning rate multiplier for this Parameter. The actual learning rate is calculated with ``learning_rate * lr_mult``. You can set it with ``param.lr_mult = 2.0`` wd_mult : float Local weight decay multiplier for this Parameter. twritegð?tdefaultc Csd|_d|_d|_d|_d|_d|_d|_| |_||_ d|_ t |t ƒru|f}n||_ ||_||_||_||_||_||_dddg} | | ksåtd|| fƒ‚| | kstd|| fƒ‚| |_| |_dS(NRt row_sparsetcsrs\grad_stype for Parameter '%s' must be one of 'default', 'row_sparse', or 'csr', but got '%s'sWstype for Parameter '%s' must be one of 'default', 'row_sparse', or 'csr', but got '%s'((tNonet_vart_datat_gradt _ctx_listt_ctx_mapt_trainert_deferred_initt_differentiablet_allow_deferred_initt _grad_reqt isinstancetintt_shapetnamet_dtypetlr_multtwd_multtgrad_reqtinittAssertionErrort _grad_stypet_stype( tselfR(R,tshapetdtypeR*R+R-tallow_deferred_inittdifferentiabletstypet grad_stypet valid_stypes((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyt__init__gs4                   cCs+d}|jd|jd|jd|jƒS(Ns/Parameter {name} (shape={shape}, dtype={dtype})R(R2R3(tformatR(R2R3(R1ts((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyt__repr__‡scCs|jS(N(R$(R1((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR,‹scCs¶|dkstd|ƒ‚|js.d}n|j|krAdS||_|dkr–|jdk r–d|_g|jD]}|jƒ^qx|_n|jdk r²|jƒndS(NRtaddtnulls?grad_req must be one of 'write', 'add', or 'null', but got '%s'(RR=R>(R.R"R$RRRtdetacht _init_grad(R1treqti((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR,s     (cCs|jS(sxThe type of the parameter. Setting the dtype value is equivalent to casting the value of the parameter (R)(R1((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR3žscCs|j|ƒdS(N(tcast(R1R3((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR3¦scCs>|jdkrdStƒr3td„|jDƒƒS|jSdS(s®The shape of the parameter. By default, an unknown dimension size is 0. However, when the NumPy semantic is turned on, unknown dimension size is -1. css'|]}|dkr|ndVqdS(iiÿÿÿÿN((t.0RB((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pys ·sN(R'RRttuple(R1((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR2ªs  cCs‹|jdkr||_dSt|jƒt|ƒkrYtd„t||jƒDƒƒs~tdt|ƒt|jƒfƒ‚||_dS(Ncss'|]\}}|d|fkVqdS(iN((RDRBtj((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pys Âss6Expected shape %s is incompatible with given shape %s.(R'RtlentalltzipR.tstr(R1t new_shape((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR2»s %cCsY|jdkrL|jrL|rL|j|k rLtd|j|jfƒ‚n||_dS(s4 Set the trainer this parameter is associated with. Rs„Failed to set the trainer for Parameter '%s' because it was already set. More than one trainers for a %s Parameter is not supported.N(R0R t RuntimeErrorR((R1ttrainer((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyt _set_trainerÈs -cCs|dk rÌ|tkr|S|dkrQt|ƒdkrB|dStjƒ}n|j|jd@}|jt|ƒkrž||j}|dk rž||Sntd|j t |ƒt |j ƒfƒ‚n|j rët d|j ƒ‚ntd|j ƒ‚dS(NiisPParameter '%s' was not initialized on context %s. It was only initialized on %s.sGParameter '%s' has not been initialized yet because initialization was deferred. Actual initialization happens during the first forward pass. Please pass one batch of data through the network before accessing Parameters. You can also avoid deferred initialization by specifying in_units, num_features, etc., for network layers.sßParameter '%s' has not been initialized. Note that you should initialize parameters and create Trainer with Block.collect_params() instead of Block.params because the later does not include Parameters of nested child Blocks(RtlistRGR tcurrent_contextRt device_typeidt device_idRLR(RJRR!R(R1tarr_listtctxtctx_listtidx((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyt_check_and_getÒs,      ( cCsvt|tjƒs+tdt|ƒƒ‚n|jsJtd|jƒ‚n|j||ƒ}|jj |||ƒ|S(sA Get row_sparse data from row_sparse parameters based on row_id. s.row_id must have NDArray type, but %s is givensQCannot get row_sparse data for Parameter '%s' when no Trainer is created with it.( R%R tNDArrayt TypeErrorttypeR RLR(RWt_row_sparse_pull(R1RSRTtrow_idtresults((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyt_get_row_sparseòs tcurrentcCsÙ|r|d kst‚n|jrµxct|j|jƒD]L\}}|d|fks:td|jt|jƒt|jƒfƒ‚q:Wtd„t|j|jƒDƒƒ|_n|jrv|r'tj|jƒj|jkr'|dkr |j |jdt ƒ}qs|dkrs|j|_qsqvtj|jƒj|jksvtd|jt|jƒt|jƒfƒ‚n|j |j kr|j |j ƒ}nt|tƒr¸|g}n|jd krg|jr9|d ks)t|ƒt|jdƒks)td |jt|ƒt|jƒƒfƒ‚|jd}n|d krTtƒg}n|j||ƒne|d ks¿t|ƒt|jƒƒks¿td |jt|ƒt|jƒƒfƒ‚|j|ƒd |_d S( s (Re)initializes by loading from data. Parameters ---------- data : NDArray The data to load ctx : Context or list of Context Context(s) initialize loaded parameters on. cast_dtype : bool, default False Cast the data type of the parameter dtype_source : str, default 'current' must be in {'current', 'saved'} Only valid if cast_dtype=True, specify the source of the dtype for casting the parameters R_tsavedis[Failed loading Parameter '%s' from saved params: shape incompatible expected %s vs saved %scss-|]#\}}|dkr!|n|VqdS(iN((RDRBRF((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pys stcopys“Failed loading Parameter '%s' from saved params: dtype incompatible expected %s vs saved %s. Set cast_dtype=True to cast the dtype of saved params.isNFailed to load Parameter '%s' on %s because it was previous initialized on %s.N(R_R`((R.R2RIR(RJRER3tnpRZtastypetFalseR0R6ttostypeR%R RRR!tsettlist_ctxR t _init_impltset_data(R1tdataRTt cast_dtypet dtype_sourcetself_dimtdata_dim((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyt _load_initsF ",+ $  !+  .( -( c Csñ|js dS|j\}}}}d|_t|jƒs\td|jt|jƒfƒ‚tjƒƒ|dkr×t j d|jd|j dt j ƒd|jƒ}tj|ƒtj|ji|d6ƒ|ƒn|j||ƒWdQXdS( s!Finishes deferred initialization.NszCannot initialize Parameter '%s' because it has invalid shape: %s. Please specify in_units, in_channels, etc for `Block`s.R2R3RTR6R9((R!RR2R.R(RJRtpauseRR tzerosR3R R R0R tcreatetInitDescRh(R1R-RTt default_initRj((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyt_finish_deferred_init;s     #cCs¾t|ƒ|_ggg|_xgt|jƒD]V\}}|j|jd@}x&t|ƒ|jkrv|jdƒqQW|||jNR2R3RTR6(R,RRRR RqR2R3R R/Rtmark_variablesRWRO(R1RB((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR@]s Fcs¶tjƒ‰|jdkrS|jƒ}tj‡fd†|DƒŒt|ƒ}n_tjd|jddddˆƒ}tj |jdddˆƒ}|j j |||d t ƒ|S( s)Reduce data from multiple context to cpu.Rc3s|]}|jˆƒVqdS(N(Rx(RDtw(RT(s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pys nsiR3tint64RTR6Rtfull_idx( R R R0t list_dataR tadd_nRGtarangeR2RqR R[tTrue(R1tblockRjt all_row_ids((RTs6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyt_reduceis  ,%cCs#|jdk r4| r4tjd|jddƒdSd|_|_|dkrbtjƒg}nt|t ƒr}|g}n|dkrª|j dkrž|n|j }nt |j ƒs|j rÛ|||df|_dStd|jt|j ƒfƒ‚n|||df|_|jƒdS(sŒInitializes parameter and gradient arrays. Only used for :py:class:`NDArray` API. Parameters ---------- init : Initializer The initializer to use. Overrides :py:meth:`Parameter.init` and default_init. ctx : Context or list of Context, defaults to :py:meth:`context.current_context()`. Initialize Parameter on given context. If ctx is a list of Context, a copy will be made for each context. .. note:: Copies are independent arrays. User is responsible for keeping their values consistent when updating. Normally :py:class:`gluon.Trainer` does this for you. default_init : Initializer Default initializer is used when both :py:func:`init` and :py:meth:`Parameter.init` are ``None``. force_reinit : bool, default False Whether to force re-initialization if parameter is already initialized. Examples -------- >>> weight = mx.gluon.Parameter('weight', shape=(2, 2)) >>> weight.initialize(ctx=mx.cpu(0)) >>> weight.data() [[-0.01068833 0.01729892] [ 0.02042518 -0.01618656]] >>> weight.grad() [[ 0. 0.] [ 0. 0.]] >>> weight.initialize(ctx=[mx.gpu(0), mx.gpu(1)]) >>> weight.data(mx.gpu(0)) [[-0.00873779 -0.02834515] [ 0.05484822 -0.06206018]] >>> weight.data(mx.gpu(1)) [[-0.00873779 -0.02834515] [ 0.05484822 -0.06206018]] sXParameter '%s' is already initialized, ignoring. Set force_reinit=True to re-initialize.t stackleveliNsBCannot initialize Parameter '%s' because it has invalid shape: %s.(RRtwarningstwarnR(RR RPR%R R-RR2R#R!t ValueErrorRJRu(R1R-RTRtt force_reinit((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyt initializevs(-     ! cCsÁ|dkrtjƒg}nt|tƒr9|g}n|jrt|jƒ}tjƒ|j ||ƒWdQXnI|j rª|j \}}}}||||f|_ nt d|j ƒ‚dS(s%Re-assign Parameter to other contexts. Parameters ---------- ctx : Context or list of Context, default ``context.current_context()``. Assign Parameter to given context. If ctx is a list of Context, a copy will be made for each context. NsLCannot reset context for Parameter '%s' because it has not been initialized.( RR RPR%R RR„RRpRhR!RˆR((R1RTRjR-t_Rt((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyt reset_ctxºs      cCsÃ|j|_|jdkrR|js7td|jƒ‚|jd |f|_dS|jr˜|jjr˜|jjr˜||jj kr˜|jj ƒq˜nx$|j |jt ƒD] }||(q®WdS(s,Sets this parameter's value on all contexts.s'Parameter '%s' has not been initializediN( R2RRR!R.R(R t_kv_initializedt_update_on_kvstoret_params_to_initt_reset_kvstoreRWRO(R1Rjtarr((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyRiÓs  !cCsG|jdkr.td|j|jfƒ‚n|j|j|j|ƒS(s©Returns a copy of the 'row_sparse' parameter on the same context as row_id's. The copy only retains rows whose ids occur in provided row ids. The parameter must have been initialized on this context before. Parameters ---------- row_id: NDArray Row ids to retain for the 'row_sparse' parameter. Returns ------- NDArray on row_id's context RsuCannot return a copy of Parameter %s via row_sparse_data() because its storage type is %s. Please use data() instead.(R0RLR(R^RR (R1R\((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pytrow_sparse_dataåscCsD|jdkr.td|j|jfƒ‚n|j|jt|ƒS(sReturns copies of the 'row_sparse' parameter on all contexts, in the same order as creation. The copy only retains rows whose ids occur in provided row ids. The parameter must have been initialized before. Parameters ---------- row_id: NDArray Row ids to retain for the 'row_sparse' parameter. Returns ------- list of NDArrays RsŒCannot return copies of Parameter '%s' on all contexts via list_row_sparse_data() because its storage type is %s. Please use data() instead.(R0RLR(R^RRO(R1R\((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pytlist_row_sparse_dataùscCsJ|jdkr7td|jt|ƒ|jfƒ‚n|j|j|ƒS(sWReturns a copy of this parameter on one context. Must have been initialized on this context before. For sparse parameters, use :py:meth:`Parameter.row_sparse_data` instead. Parameters ---------- ctx : Context Desired context. Returns ------- NDArray on ctx RsCannot return a copy of Parameter '%s' on ctx %s via data() because its storage type is %s. Please use row_sparse_data() instead.(R0RLR(RJRWR(R1RT((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyRj s"cCsA|jdkr.td|j|jfƒ‚n|j|jtƒS(sñReturns copies of this parameter on all contexts, in the same order as creation. For sparse parameters, use :py:meth:`Parameter.list_row_sparse_data` instead. Returns ------- list of NDArrays RsŒCannot return copies of Parameter '%s' on all contexts via list_data() because its storage type is %s. Please use row_sparse_data() instead.(R0RLR(RWRRO(R1((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR~!s cCsG|jdk r4|jdkr4td|jƒ‚n|j|j|ƒS(sŸReturns a gradient buffer for this parameter on one context. Parameters ---------- ctx : Context Desired context. sDCannot get gradient array for Parameter '%s' because grad_req='null'N(RRRRLR(RW(R1RT((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pytgrad0s cCsG|jdk r4|jdkr4td|jƒ‚n|j|jtƒS(sYReturns gradient buffers on all contexts, in the same order as :py:meth:`values`.sDCannot get gradient array for Parameter '%s' because grad_req='null'N(RRRRLR(RWRO(R1((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyt list_grad>s cCs@|jdkr9|jr#|jdStd|jƒ‚n|jS(s<Returns a list of contexts this parameter is initialized on.is'Parameter '%s' has not been initializedN(RRR!RLR(R(R1((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyRgGs   cCs>|jdkrdSx$|jD]}tj|d|ƒqWdS(s€Sets gradient buffer on all contexts to 0. No action is taken if parameter is uninitialized or doesn't require gradient.Ntout(RRR t zeros_like(R1RB((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyt zero_gradOscCsd|jdkr]tj|jd|jd|jd|jd|jd|j d|j ƒ|_n|jS(s-Returns a symbol representing this parameter.R2R3R*R+R-R6N( RRRtvarR(R2R3R*R+R-R0(R1((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR™Ws !cCs²||_|jdkrdStjƒ„g|jD]}|j|ƒ^q3|_|jdkrddSg|jD]}|j|ƒ^qn|_tj|j|j|jƒWdQXdS(s®Cast data and gradient of this Parameter to a new data type. Parameters ---------- dtype : str or numpy.dtype The new data type. N( R)RRRRpRcRRzR,(R1R3RB((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyRC_s  ((N(%RRRRRRdRR9R<tpropertyR,tsetterR3R2RNRWR^RoRuRhR@R„R tUniformRŠRŒRiR’R“RjR~R”R•RgR˜R™RC(((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR,sB:    ;   C          cBsAeZdZd„Zd„Zed„ƒZejd„ƒZRS(sÈA constant parameter for holding immutable tensors. `Constant`s are ignored by `autograd` and `Trainer`, thus their values will not change during training. But you can still update their values manually with the `set_data` method. `Constant` s can be created with either:: const = mx.gluon.Constant('const', [[1,2],[3,4]]) or:: class Block(gluon.Block): def __init__(self, **kwargs): super(Block, self).__init__(**kwargs) self.const = self.params.get_constant('const', [[1,2],[3,4]]) Parameters ---------- name : str Name of the parameter. value : array-like Initial value for the constant. c s¯tˆtjƒs$tjˆƒ‰nˆ|_dtjf‡fd†ƒY}dj|t|ƒƒ}tj |ƒ|ƒt t |ƒj |dddˆj dˆjd|ƒdS( NtInitcseZ‡fd†ZRS(csˆj|ƒdS(N(Rx(R1R‹R‘(tvalue(s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyt _init_weights(RRRŸ((Rž(s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyRssConstant_{}_{}R,R>R2R3R-(R%R RXtarrayRžR t InitializerR:tidtaliastsuperRR9R2R3(R1R(RžRt init_name((Ržs6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR9Šs cCs+d}|jd|jd|jd|jƒS(Ns.Constant {name} (shape={shape}, dtype={dtype})R(R2R3(R:R(R2R3(R1R;((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR<™scCsdS(NR>((R1((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR,scCs/|dkr+tjdj|j|ƒƒndS(NR>scConstant parameter "{}" does not support grad_req other than "null", and new value "{}" is ignored.(R†R‡R:R((R1RA((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR,¡s  (RRRR9R<RšR,R›(((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyRrs   cBsæeZdZddd„Zd„Zd„Zd„Zd„Zd„Z d„Z e d „ƒZ d „Z d „Zdd „Zd „Zejƒdeed„Zd„Zd„Zd„Zdd„Zdeededd„ZRS(s·A dictionary managing a set of parameters. Parameters ---------- prefix : str, default ``''`` The prefix to be prepended to all Parameters' names created by this dict. shared : ParameterDict or None If not ``None``, when this dict's :py:meth:`get` method creates a new parameter, will first try to retrieve it from "shared" dict. Usually used for sharing parameters with another Block. tcCs"||_tƒ|_||_dS(N(t_prefixRt_paramst_shared(R1tprefixtshared((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR9µs  c Csld}|jr|jdnd}|jd|ddjg|jƒD]}tdj|ƒdƒ^qDƒƒS( Ns{name}( {content} )t R¦R(tcontents s {0}i(R§R:tjointvaluesR(R1R;R(tv((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR<ºs  cCs |j|S(N(R¨(R1tkey((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyt __getitem__ÁscCs t|jƒS(N(titerR¨(R1((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyt__iter__ÄscCs |jjƒS(N(R¨titems(R1((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyRµÇscCs |jjƒS(N(R¨tkeys(R1((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR¶ÊscCs |jjƒS(N(R¨R¯(R1((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR¯ÍscCs|jS(snPrefix of this dict. It will be prepended to :py:class:`Parameter`s' name created with :py:func:`get`.(R§(R1((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyRªÐscCsd||jkr|j|S|jdk r`||jjkr`|jj||j|<|jj|SdS(N(R¨R©R(R1R(((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyt _get_implÖs  !c Ks|j|}|j|ƒ}|dkrGt||}||j|Âs sˆParameter '%s' is missing in file '%s', which contains parameters: %s. Please make sure source and target networks have the same prefix.s¼Parameter '%s' loaded from file '%s' is not present in ParameterDict, choices are: %s. Set ignore_extra to True to ignore. Please make sure source and target networks have the same prefix.RkRlN( R¶RËR.RGR tloadR%tdictRµRR¨Ro(R1RÍRTt allow_missingt ignore_extraRÑRkRlR(tlprefixt ndarray_loadR½R°tloadedRÏ((RÑs6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyRÒ s* h*  &N(RRRRR9R<R²R´RµR¶R¯RšRªR·RÃRÆRÈR RœRdRŠR˜RŒRºRÌRÒ(((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyR©s,         9 (      (Rt__all__t collectionsRR†tnumpyRbtbaseRRR¦RR R R R R RtutilsRRRRtSymbolRXRRtobjectRRR(((s6/tmp/pip-install-Qvdv_2/mxnet/mxnet/gluon/parameter.pyts$    "ÿÿH7