code: def check_hidden_states_output(
      self, inputs_dict, config, model_class, image_size
  ):
      model = model_class(config)
      outputs = model(
          **self._prepare_for_class(inputs_dict, model_class)
      )
      hidden_states = outputs.hidden_states
  
      expected_num_layers = getattr(
          self.model_tester,
          "expected_num_hidden_layers",
          len(self.model_tester.depths) + 1,
      )
      self.assertEqual(len(hidden_states), expected_num_layers)
  
      # Swin has a different seq_length
      patch_size = to_2tuple(config.patch_size)
  
      num_patches = (image_size[1] // patch_size[1]) * (
          image_size[0] // patch_size[0]
      )
  
      self.assertListEqual(
          list(hidden_states[0].shape[-2:]),
          [num_patches, self.model_tester.embed_dim],
      )
  
      reshaped_hidden_states = outputs.reshaped_hidden_states
      self.assertEqual(len(reshaped_hidden_states), expected_num_layers)
  
      batch_size, num_channels, height, width = reshaped_hidden_states[
          0
      ].shape
  
      reshaped_hidden_states = tf.reshape(
          reshaped_hidden_states[0],
          (batch_size, num_channels, height * width),
      )
      reshaped_hidden_states = tf.transpose(
          reshaped_hidden_states, (0, 2, 1)
      )
  
      self.assertListEqual(
          list(reshaped_hidden_states.shape[-2:]),
          [num_patches, self.model_tester.embed_dim],
      )
  
imports: import inspect
  import unittest
  import numpy
  from transformers import SwinConfig
  from transformers.testing_utils import require_tf, require_vision, slow, to_2tuple, tooslow
  from transformers.utils import cached_property, is_tf_available, is_vision_available
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_tf_common import TFModelTesterMixin, floats_tensor, ids_tensor
label_desc: Use image node_id 12 for calling the TFSwinModelTest obj's underlying member method code with example usage: obj.check_hidden_states_output(inputs_dict, config, model_class, image_size) without return types