code: def test_hidden_states_output(self):
      (
          config,
          inputs_dict,
      ) = self.model_tester.prepare_config_and_inputs_for_common()
  
      def check_hidden_states_output(config, inputs_dict, model_class):
          model = model_class(config)
          outputs = model(
              self._prepare_for_class(inputs_dict, model_class)
          )
          expected_num_layers = getattr(
              self.model_tester,
              "expected_num_hidden_layers",
              self.model_tester.num_hidden_layers + 1,
          )
  
          hidden_states = outputs.hidden_states
          self.assertEqual(config.output_attentions, False)
          self.assertEqual(len(hidden_states), expected_num_layers)
          self.assertListEqual(
              list(hidden_states[0].shape[-2:]),
              [
                  self.model_tester.output_seq_length,
                  self.model_tester.hidden_size,
              ],
          )
  
      for model_class in self.all_model_classes:
          inputs_dict["output_hidden_states"] = True
          check_hidden_states_output(config, inputs_dict, model_class)
  
          del inputs_dict["output_hidden_states"]
          config.output_hidden_states = True
          check_hidden_states_output(config, inputs_dict, model_class)
  
imports: import copy
  import inspect
  import math
  import unittest
  import numpy
  import pytest
  from transformers import is_tf_available
  from transformers.testing_utils import require_soundfile, require_tf, slow
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor
label_desc: Use image node_id 6 for calling the TFHubertRobustModelTest obj's underlying member method code with example usage: obj.test_hidden_states_output() without return types