(self, pdict)
Set layer parameters (weights). Allocate space for other parameters but do not initialize
        them.
        Arguments:
            pdict (dict, ndarray): dictionary or ndarray with layer parameters
                                   [support for ndarray is DEPRECATED and will be removed]
Set layer parameters (weights). Allocate space for other parameters but do not initialize
        them.
        Arguments:
            pdict (dict, ndarray): dictionary or ndarray with layer parameters
                                   [support for ndarray is DEPRECATED and will be removed]
Set layer parameters ( weights ) . Allocate space for other parameters but do not initialize them . Arguments : pdict ( dict ndarray ) : dictionary or ndarray with layer parameters [ support for ndarray is DEPRECATED and will be removed ]
def set_params(self, pdict):
        """
        Set layer parameters (weights). Allocate space for other parameters but do not initialize
        them.
        Arguments:
            pdict (dict, ndarray): dictionary or ndarray with layer parameters
                                   [support for ndarray is DEPRECATED and will be removed]
        """

        if type(pdict) is list:
            logger.error('Using old serialization format with unfused bias. This will be'
                         ' deprecated in future release. Resave serialized file'
                         ' using current format.')
            pdict = self.convert_format(pdict)

        for key, val in pdict['params'].items():
            if not hasattr(self, key):
                setattr(self, key, None)

            if isinstance(getattr(self, key), Tensor):
                getattr(self, key).set(val)
            elif isinstance(val, np.ndarray):
                setattr(self, key, self.be.array(val, **self.get_param_attrs()))
            else:
                setattr(self, key, val)

        if self.dW is None:
            assert self.W is not None
            self.dW = self.be.empty_like(self.W)

        if self.grad_bias is None:
            assert self.weight_bias is not None
            self.grad_bias = self.be.empty_like(self.weight_bias)
def set_params ( self , pdict ) : if type ( pdict ) is list : logger . error ( 'Using old serialization format with unfused bias. This will be' ' deprecated in future release. Resave serialized file' ' using current format.' ) pdict = self . convert_format ( pdict ) for key , val in pdict [ 'params' ] . items ( ) : if not hasattr ( self , key ) : setattr ( self , key , None ) if isinstance ( getattr ( self , key ) , Tensor ) : getattr ( self , key ) . set ( val ) elif isinstance ( val , np . ndarray ) : setattr ( self , key , self . be . array ( val , * * self . get_param_attrs ( ) ) ) else : setattr ( self , key , val ) if self . dW is None : assert self . W is not None self . dW = self . be . empty_like ( self . W ) if self . grad_bias is None : assert self . weight_bias is not None self . grad_bias = self . be . empty_like ( self . weight_bias )