'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):

    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):
            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)
