import tensorflow as tf

                    test_data.decoded_x.name)

    if is_adaptive_stage(stage):
      # The property should have keys matching those of state_update_tensors.
      self.assertSameElements(stage.state_update_aggregation_modes.keys(),
                              test_data.state_update_tensors.keys())
      for mode in six.itervalues(stage.state_update_aggregation_modes):
        self.assertIn(mode, encoding_stage.StateAggregationMode)

      for tensor in six.itervalues(test_data.initial_state):
        self.assertTrue(tf.is_tensor(tensor))
      for tensor in six.itervalues(test_data.state_update_tensors):
        self.assertTrue(tf.is_tensor(tensor))
      for tensor in six.itervalues(test_data.updated_state):
        self.assertTrue(tf.is_tensor(tensor))

      # The state related Tensors should have appropriate substrings in their
      # names.
      for tensor in six.itervalues(test_data.initial_state):
        self.assertIn(encoding_stage.INITIAL_STATE_SCOPE_SUFFIX, tensor.name)
      for tensor in six.itervalues(test_data.updated_state):
        self.assertIn(encoding_stage.UPDATE_STATE_SCOPE_SUFFIX, tensor.name)
      for tensor in six.itervalues(test_data.state_update_tensors):
        self.assertIn(encoding_stage.ENCODE_SCOPE_SUFFIX, tensor.name)

  def asserts_for_test_many_to_one_encode_decode(self, data):
    """Additional asserts for `test_many_to_one_encode_decode` method.

