import tensorflow as tf

        an `AdaptiveEncodingStageInterface`.

    Returns:
      A tuple `(server_test_data, decode_params)` where these are:
      server_test_data: A `list` of `TestData` tuples containing numpy values
        representing the results of encoding for each element of `input_values`.
      decode_params: Numpy values of the decode parameters used. These are
        values that should be used if additional decoding is to be done, such as
        for `assert_commutes_with_sum`.
    """

    def _adaptive_many_to_one_encode_decode(state):
      """Implementation of the method for `AdaptiveEncodingStageInterface`."""
      server_graph = tf.Graph()
      with server_graph.as_default():
        shape = input_values[0].shape
        if state is None:
          state = stage.initial_state()
        encode_params, decode_params = stage.get_params(state)
      with self.session(server_graph) as sess:
        encode_params, decode_params, state = self.evaluate_tf_py_list(
            [encode_params, decode_params, state], sess)

      client_test_data = []
      for x in input_values:
        client_graph = tf.Graph()
