import tensorflow as tf


      return server_test_data, decode_params

    def _non_adaptive_many_to_one_encode_decode():
      """Implementation of the method for `EncodingStageInterface`."""
      server_graph = tf.Graph()
      with server_graph.as_default():
        shape = input_values[0].shape
        encode_params, decode_params = stage.get_params()
      with self.session(server_graph) as sess:
        encode_params, decode_params = self.evaluate_tf_py_list(
            [encode_params, decode_params], sess)

      client_test_data = []
      for x in input_values:
        client_graph = tf.Graph()
        with client_graph.as_default():
          encoded_x = stage.encode(x, encode_params)
        with self.session(client_graph):
          encoded_x = self.evaluate(encoded_x)
          client_test_data.append(TestData(x, encoded_x))

      server_test_data = []
      with server_graph.as_default():
        with self.session(server_graph) as sess:
          for test_data in client_test_data:
            decoded_x = stage.decode(
                test_data.encoded_x, decode_params, shape=shape)
            server_test_data.append(
                test_data._replace(decoded_x=sess.run(decoded_x)))
