def init_params(self, shape):
        (nout, nin) = shape
        g_nout = self.ngates * nout
        doFill = False

        if self.W is None:
            self.W = self.be.empty((nout + nin + 1, g_nout))
            self.dW = self.be.zeros_like(self.W)
            doFill = True
        else:
            # Deserialized weights and empty grad
            assert self.W.shape == (nout + nin + 1, g_nout)
            assert self.dW.shape == (nout + nin + 1, g_nout)

        self.W_input = self.W[:nin].reshape((g_nout, nin))
        self.W_recur = self.W[nin:-1].reshape((g_nout, nout))
        self.b = self.W[-1:].reshape((g_nout, 1))

        if doFill:
            gatelist = [g * nout for g in range(0, self.ngates + 1)]
            for wtnm in ('W_input', 'W_recur'):
                wtmat = getattr(self, wtnm)
                if wtnm is 'W_recur' and self.init_inner is not None:
                    initfunc = self.init_inner
                else:
                    initfunc = self.init

                for gb, ge in zip(gatelist[:-1], gatelist[1:]):
                    initfunc.fill(wtmat[gb:ge])
            self.b.fill(0.)

        self.dW_input = self.dW[:nin].reshape(self.W_input.shape)
        self.dW_recur = self.dW[nin:-1].reshape(self.W_recur.shape)
        self.db = self.dW[-1:].reshape(self.b.shape)
Initialize params including weights and biases.
dataset/ETHPy150Open NervanaSystems/neon/neon/layers/recurrent.py/Recurrent.init_params