code: def create_and_check_get_image_hidden_states(
      self, config, pixel_values
  ):
      model = TFSamModel(config=config)
      result = model.vision_encoder(
          pixel_values,
          output_hidden_states=True,
          return_dict=True,
      )
  
      # after computing the convolutional features
      expected_hidden_states_shape = (self.batch_size, 12, 12, 36)
      self.parent.assertEqual(
          len(result[1]), self.num_hidden_layers + 1
      )
      self.parent.assertEqual(
          result[1][0].shape, expected_hidden_states_shape
      )
  
      result = model.vision_encoder(
          pixel_values,
          output_hidden_states=True,
          return_dict=False,
      )
  
      # after computing the convolutional features
      expected_hidden_states_shape = (self.batch_size, 12, 12, 36)
      self.parent.assertEqual(
          len(result[1]), self.num_hidden_layers + 1
      )
      self.parent.assertEqual(
          result[1][0].shape, expected_hidden_states_shape
      )
  
imports: from __future__ import annotations
  import inspect
  import unittest
  import numpy
  import requests
  from transformers import SamConfig, SamMaskDecoderConfig, SamPromptEncoderConfig, SamVisionConfig
  from transformers.testing_utils import require_tf, slow
  from transformers.utils import is_tf_available, is_vision_available
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_tf_common import TFModelTesterMixin, floats_tensor
  from ...test_pipeline_mixin import PipelineTesterMixin
label_desc: Use image node_id 6 for calling the TFSamModelTester obj's underlying member method code with example usage: obj.create_and_check_get_image_hidden_states(config, pixel_values) without return types