class_docstr: Here we also overwrite some of the tests of test_modeling_common.py, as Data2VecVision does not use input_ids, inputs_embeds,
  attention_mask and seq_length.
code: def test_training_gradient_checkpointing(self):
      (
          config,
          inputs_dict,
      ) = self.model_tester.prepare_config_and_inputs_for_common()
      if not self.model_tester.is_training:
          return
  
      config.use_cache = False
      config.return_dict = True
  
      for model_class in self.all_model_classes:
          if (
              model_class in [*get_values(MODEL_MAPPING)]
              or not model_class.supports_gradient_checkpointing
          ):
              continue
          # TODO: remove the following 3 lines once we have a MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING
          # this can then be incorporated into _prepare_for_class in test_modeling_common.py
          elif (
              model_class.__name__
              == "Data2VecVisionForSemanticSegmentation"
          ):
              batch_size, num_channels, height, width = inputs_dict[
                  "pixel_values"
              ].shape
              inputs_dict["labels"] = torch.zeros(
                  [self.model_tester.batch_size, height, width],
                  device=torch_device,
              ).long()
          model = model_class(config)
          model.gradient_checkpointing_enable()
          model.to(torch_device)
          model.train()
          inputs = self._prepare_for_class(
              inputs_dict, model_class, return_labels=True
          )
          loss = model(**inputs).loss
          loss.backward()
  
imports: import inspect
  import unittest
  from transformers import Data2VecVisionConfig
  from transformers.models.auto import get_values
  from transformers.testing_utils import require_torch, require_torch_multi_gpu, require_vision, slow, torch_device
  from transformers.utils import cached_property, is_torch_available, is_vision_available
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, _config_zero_init, floats_tensor, ids_tensor
label_desc: Use image node_id 10 for calling the Data2VecVisionModelTest obj's underlying member method code with example usage: obj.test_training_gradient_checkpointing() without return types