def to_gpu(self, device=None): super(NStepLSTM, self).to_gpu(device) if self.cx is not None: self.cx.to_gpu(device) if self.hx is not None: self.hx.to_gpu(device)