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_keras_fit(self):
      (
          config,
          _,
      ) = self.model_tester.prepare_config_and_inputs_for_common()
      for model_class in self.all_model_classes:
          # Since `TFData2VecVisionModel` cannot operate with the default `fit()` method.
          if model_class.__name__ != "TFData2VecVisionModel":
              model = model_class(config)
              if getattr(model, "hf_compute_loss", None):
                  # Test that model correctly compute the loss with kwargs
                  (
                      _,
                      prepared_for_class,
                  ) = (
                      self.model_tester.prepare_config_and_inputs_for_keras_fit()
                  )
  
                  label_names = {"labels"}
                  self.assertGreater(
                      len(label_names),
                      0,
                      msg="No matching label names found!",
                  )
                  labels = {
                      key: val
                      for key, val in prepared_for_class.items()
                      if key in label_names
                  }
                  inputs_minus_labels = {
                      key: val
                      for key, val in prepared_for_class.items()
                      if key not in label_names
                  }
                  self.assertGreater(len(inputs_minus_labels), 0)
                  model.compile(
                      optimizer=tf.keras.optimizers.SGD(0.0),
                      run_eagerly=True,
                  )
  
                  # Make sure the model fits without crashing regardless of where we pass the labels
                  history1 = model.fit(
                      prepared_for_class,
                      validation_data=prepared_for_class,
                      steps_per_epoch=1,
                      validation_steps=1,
                      shuffle=False,
                  )
                  val_loss1 = history1.history["val_loss"][0]
                  history2 = model.fit(
                      inputs_minus_labels,
                      labels,
                      validation_data=(inputs_minus_labels, labels),
                      steps_per_epoch=1,
                      validation_steps=1,
                      shuffle=False,
                  )
                  val_loss2 = history2.history["val_loss"][0]
                  self.assertTrue(
                      np.allclose(
                          val_loss1, val_loss2, atol=1e-2, rtol=1e-3
                      )
                  )
  
imports: import collections.abc
  import inspect
  import unittest
  import numpy
  from transformers import Data2VecVisionConfig
  from transformers.file_utils import cached_property, is_tf_available, is_vision_available
  from transformers.testing_utils import require_tf, require_vision, slow
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_tf_common import TFModelTesterMixin, floats_tensor, ids_tensor
label_desc: Use image node_id 11 for calling the TFData2VecVisionModelTest obj's underlying member method code with example usage: obj.test_keras_fit() without return types