code: def test_hidden_states_output(self):
      (
          config,
          inputs,
      ) = self.model_tester.prepare_config_and_inputs_for_common()
      self.model_tester.create_and_check_mask2former_model(
          config, **inputs, output_hidden_states=True
      )
  
imports: import unittest
  import numpy
  from tests.test_modeling_common import floats_tensor
  from transformers import Mask2FormerConfig, is_torch_available, is_vision_available
  from transformers.testing_utils import require_torch, require_torch_accelerator, require_torch_fp16, require_torch_multi_gpu, require_vision, slow, torch_device
  from transformers.utils import cached_property
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin
  from ...test_pipeline_mixin import PipelineTesterMixin
label_desc: Use image node_id 12 for calling the Mask2FormerModelTest obj's underlying member method code with example usage: obj.test_hidden_states_output() without return types