def convert_to_state(self, variables): if len(variables) != 2: raise ValueError() return LSTMStateTuple(variables[0], variables[1])