def forward(self, x, state):
    z = F.sigmoid((self.update_x(x) + self.update_h(state)))
    r = F.sigmoid((self.reset_x(x) + self.reset_h(state)))
    mem = F.tanh((self.memory_x(x) + self.memory_h(torch.mul(r, state))))
    state = (torch.mul((1 - z), state) + torch.mul(z, mem))
    return state
def forward(self, x, state):
    z = F.sigmoid((self.update_x(x) + self.update_h(state)))
    r = F.sigmoid((self.reset_x(x) + self.reset_h(state)))
    mem = F.tanh((self.memory_x(x) + self.memory_h(torch.mul(r, state))))
    state = (torch.mul((1 - z), state) + torch.mul(z, mem))
    return state