(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.
Set layer parameters ( weights ) . Allocate space for other parameters but do not initialize them .
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]
        """
        assert type(pdict) is dict
        for key in pdict['params']:
            if not hasattr(self, key):
                setattr(self, key, None)

            attr = getattr(self, key)
            if isinstance(attr, Tensor):
                # this attr has already been allocated
                # get set the values
                attr.set(pdict['params'][key])
            elif type(pdict['params'][key]) is np.ndarray:
                setattr(self, key, self.be.array(pdict['params'][key], **self.get_param_attrs()))
            else:
                setattr(self, key, pdict['params'][key])

        if self.dW is None:
            self.dW = self.be.empty_like(self.W)
def set_params ( self , pdict ) : assert type ( pdict ) is dict for key in pdict [ 'params' ] : if not hasattr ( self , key ) : setattr ( self , key , None ) attr = getattr ( self , key ) if isinstance ( attr , Tensor ) : # this attr has already been allocated # get set the values attr . set ( pdict [ 'params' ] [ key ] ) elif type ( pdict [ 'params' ] [ key ] ) is np . ndarray : setattr ( self , key , self . be . array ( pdict [ 'params' ] [ key ] , * * self . get_param_attrs ( ) ) ) else : setattr ( self , key , pdict [ 'params' ] [ key ] ) if self . dW is None : self . dW = self . be . empty_like ( self . W )