(self, shape)
Allocate layer parameter buffers and initialize them with the
            supplied initializer.

        Arguments:
            shape (int, tuple): shape to allocate for layer parameter
                buffers.
            accumulate_updates (bool): allocate additional scratch accumulation
                buffers.
Allocate layer parameter buffers and initialize them with the
            supplied initializer.
Allocate layer parameter buffers and initialize them with the supplied initializer .
def init_params(self, shape):
        """
        Allocate layer parameter buffers and initialize them with the
            supplied initializer.

        Arguments:
            shape (int, tuple): shape to allocate for layer parameter
                buffers.
            accumulate_updates (bool): allocate additional scratch accumulation
                buffers.
        """
        self.W = self.be.empty(shape, **self.get_param_attrs())
        self.dW = self.be.empty_like(self.W)
        self.states = []

        if isinstance(self.init, Tensor) or isinstance(self.init, np.ndarray):
            assert self.init.shape == self.W.shape, "Initial weights shape does not match"
            self.W[:] = self.init
        else:
            self.init.fill(self.W)
        if self.accumulate_updates:
            self.acc_dW = self.be.empty_like(self.dW)
            self.acc_params = [(self.acc_dW, self.dW)]
def init_params ( self , shape ) : self . W = self . be . empty ( shape , * * self . get_param_attrs ( ) ) self . dW = self . be . empty_like ( self . W ) self . states = [ ] if isinstance ( self . init , Tensor ) or isinstance ( self . init , np . ndarray ) : assert self . init . shape == self . W . shape , "Initial weights shape does not match" self . W [ : ] = self . init else : self . init . fill ( self . W ) if self . accumulate_updates : self . acc_dW = self . be . empty_like ( self . dW ) self . acc_params = [ ( self . acc_dW , self . dW ) ]