def METHOD_NAME(model):
    params = [(name, tensor.detach()) for name, tensor in model.named_parameters()]
    hidden_state = ("hidden_state", torch.stack(model.hidden_state_zoneout_mask, dim=0))
    cell_state = ("cell_state", torch.stack(model.cell_state_zoneout_mask, dim=0))
    # [hidden, input] -> [input, hidden]
    def transpose_(weight):
        return (weight[0], weight[1].transpose(1, 0))
    new_params = [transpose_(params[0]), transpose_(params[1]), params[2], params[3], hidden_state, cell_state]
    yield from new_params