class_docstr: Here we also overwrite some of the tests of test_modeling_common.py, as ConvNext does not use input_ids, inputs_embeds,
  attention_mask and seq_length.
class_docstr_tok: ["Here","we","also","overwrite","some","of","the","tests","of","test_modeling_common.py",",","as","ConvNext","does","not","use","input_ids",",","inputs_embeds",",","attention_mask","and","seq_length","."]
code: def test_model_outputs_equivalence(self):
      (
          config,
          inputs_dict,
      ) = self.model_tester.prepare_config_and_inputs_for_common()
  
      def check_equivalence(
          model, tuple_inputs, dict_inputs, additional_kwargs={}
      ):
          tuple_output = model(
              tuple_inputs, return_dict=False, **additional_kwargs
          )
          dict_output = model(
              dict_inputs, return_dict=True, **additional_kwargs
          ).to_tuple()
  
          def recursive_check(tuple_object, dict_object):
              if isinstance(tuple_object, (List, Tuple)):
                  for tuple_iterable_value, dict_iterable_value in zip(
                      tuple_object, dict_object
                  ):
                      recursive_check(
                          tuple_iterable_value, dict_iterable_value
                      )
              elif tuple_object is None:
                  return
              else:
                  self.assertTrue(
                      all(tf.equal(tuple_object, dict_object)),
                      msg=(
                          "Tuple and dict output are not equal. Difference:"
                          f" {tf.math.reduce_max(tf.abs(tuple_object - dict_object))}"
                      ),
                  )
  
              recursive_check(tuple_output, dict_output)
  
      for model_class in self.all_model_classes:
          model = model_class(config)
  
          tuple_inputs = self._prepare_for_class(
              inputs_dict, model_class
          )
          dict_inputs = self._prepare_for_class(
              inputs_dict, model_class
          )
          check_equivalence(model, tuple_inputs, dict_inputs)
  
          tuple_inputs = self._prepare_for_class(
              inputs_dict, model_class, return_labels=True
          )
          dict_inputs = self._prepare_for_class(
              inputs_dict, model_class, return_labels=True
          )
          check_equivalence(model, tuple_inputs, dict_inputs)
  
          tuple_inputs = self._prepare_for_class(
              inputs_dict, model_class
          )
          dict_inputs = self._prepare_for_class(
              inputs_dict, model_class
          )
          check_equivalence(
              model,
              tuple_inputs,
              dict_inputs,
              {"output_hidden_states": True},
          )
  
          tuple_inputs = self._prepare_for_class(
              inputs_dict, model_class, return_labels=True
          )
          dict_inputs = self._prepare_for_class(
              inputs_dict, model_class, return_labels=True
          )
          check_equivalence(
              model,
              tuple_inputs,
              dict_inputs,
              {"output_hidden_states": True},
          )
  
imports: import inspect
  import unittest
  from typing import List, Tuple
  from transformers import ConvNextConfig
  from transformers.testing_utils import require_tf, require_vision, slow
  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 10 for calling the TFConvNextModelTest obj's underlying member method code with example usage: obj.test_model_outputs_equivalence() without return types