




'''simple docstring'''






import inspect
import os
import re

from transformers.configuration_utils import PretrainedConfig
from transformers.utils import direct_transformers_import


# All paths are set with the intent you should run this script from the root of the repo with the command
# python utils/check_config_docstrings.py
A_			      =		"src/transformers"


# This is to make sure the transformers module imported is the one in the repo.
A_			      =		direct_transformers_import(PATH_TO_TRANSFORMERS)

A_			      =		transformers.models.auto.configuration_auto.CONFIG_MAPPING

A_			      =		{
    # used to compute the property `self.chunk_length`
    "EncodecConfig": ["overlap"],
    # used as `self.bert_model = BertModel(config, ...)`
    "DPRConfig": True,
    # not used in modeling files, but it's an important information
    "FSMTConfig": ["langs"],
    # used internally in the configuration class file
    "GPTNeoConfig": ["attention_types"],
    # used internally in the configuration class file
    "EsmConfig": ["is_folding_model"],
    # used during training (despite we don't have training script for these models yet)
    "Mask2FormerConfig": ["ignore_value"],
    # `ignore_value` used during training (despite we don't have training script for these models yet)
    # `norm` used in conversion script (despite not using in the modeling file)
    "OneFormerConfig": ["ignore_value", "norm"],
    # used during preprocessing and collation, see `collating_graphormer.py`
    "GraphormerConfig": ["spatial_pos_max"],
    # used internally in the configuration class file
    "T5Config": ["feed_forward_proj"],
    # used internally in the configuration class file
    # `tokenizer_class` get default value `T5Tokenizer` intentionally
    "MT5Config": ["feed_forward_proj", "tokenizer_class"],
    "UMT5Config": ["feed_forward_proj", "tokenizer_class"],
    # used internally in the configuration class file
    "LongT5Config": ["feed_forward_proj"],
    # used internally in the configuration class file
    "SwitchTransformersConfig": ["feed_forward_proj"],
    # having default values other than `1e-5` - we can't fix them without breaking
    "BioGptConfig": ["layer_norm_eps"],
    # having default values other than `1e-5` - we can't fix them without breaking
    "GLPNConfig": ["layer_norm_eps"],
    # having default values other than `1e-5` - we can't fix them without breaking
    "SegformerConfig": ["layer_norm_eps"],
    # having default values other than `1e-5` - we can't fix them without breaking
    "CvtConfig": ["layer_norm_eps"],
    # having default values other than `1e-5` - we can't fix them without breaking
    "PerceiverConfig": ["layer_norm_eps"],
    # used internally to calculate the feature size
    "InformerConfig": ["num_static_real_features", "num_time_features"],
    # used internally to calculate the feature size
    "TimeSeriesTransformerConfig": ["num_static_real_features", "num_time_features"],
    # used internally to calculate the feature size
    "AutoformerConfig": ["num_static_real_features", "num_time_features"],
    # used internally to calculate `mlp_dim`
    "SamVisionConfig": ["mlp_ratio"],
    # For (head) training, but so far not implemented
    "ClapAudioConfig": ["num_classes"],
    # Not used, but providing useful information to users
    "SpeechT5HifiGanConfig": ["sampling_rate"],
}


# TODO (ydshieh): Check the failing cases, try to fix them or move some cases to the above block once we are sure
SPECIAL_CASES_TO_ALLOW.update(
    {
        "CLIPSegConfig": True,
        "DeformableDetrConfig": True,
        "DetaConfig": True,
        "DinatConfig": True,
        "DonutSwinConfig": True,
        "EfficientFormerConfig": True,
        "FSMTConfig": True,
        "JukeboxConfig": True,
        "LayoutLMv2Config": True,
        "MaskFormerSwinConfig": True,
        "MT5Config": True,
        "NatConfig": True,
        "OneFormerConfig": True,
        "PerceiverConfig": True,
        "RagConfig": True,
        "SpeechT5Config": True,
        "SwinConfig": True,
        "Swin2SRConfig": True,
        "Swinv2Config": True,
        "SwitchTransformersConfig": True,
        "TableTransformerConfig": True,
        "TapasConfig": True,
        "TransfoXLConfig": True,
        "UniSpeechConfig": True,
        "UniSpeechSatConfig": True,
        "WavLMConfig": True,
        "WhisperConfig": True,
        # TODO: @Arthur (for `alignment_head` and `alignment_layer`)
        "JukeboxPriorConfig": True,
        # TODO: @Younes (for `is_decoder`)
        "Pix2StructTextConfig": True,
    }
)






def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		)    ->   List[str]:
      snake_case__       :   Dict	      =    False
      for attribute in attributes:
            for modeling_source in source_strings:
                  # check if we can find `config.xxx`, `getattr(config, "xxx", ...)` or `getattr(self.config, "xxx", ...)`
                  if (
                      f"config.{attribute}" in modeling_source
                      or f"getattr(config, \"{attribute}\"" in modeling_source
                      or f"getattr(self.config, \"{attribute}\"" in modeling_source
                  ):
                        snake_case__       :   Dict	      =    True
                  # Deal with multi-line cases
                  elif (
                      re.search(
                          rf"getattr[ \t\v\n\r\f]*\([ \t\v\n\r\f]*(self\.)?config,[ \t\v\n\r\f]*\"{attribute}\""				,      __SCREAMING_SNAKE_CASE				,      )
                      is not None
                  ):
                        snake_case__       :   Tuple	      =    True
                  # `SequenceSummary` is called with `SequenceSummary(config)`
                  elif attribute in [
                      "summary_type",
                      "summary_use_proj",
                      "summary_activation",
                      "summary_last_dropout",
                      "summary_proj_to_labels",
                      "summary_first_dropout",
                  ]:
                        if "SequenceSummary" in modeling_source:
                              snake_case__       :   List[Any]	      =    True
                  if attribute_used:
                        break
            if attribute_used:
                  break

    # common and important attributes, even if they do not always appear in the modeling files
      snake_case__       :   Dict	      =    [
          'bos_index',
          'eos_index',
          'pad_index',
          'unk_index',
          'mask_index',
          'image_size',
          'use_cache',
          'out_features',
          'out_indices',
      ]
      snake_case__       :   Any	      =    ['encoder_no_repeat_ngram_size']

      # Special cases to be allowed
      snake_case__       :   int	      =    True
      if not attribute_used:
            snake_case__       :   Optional[Any]	      =    False
            for attribute in attributes:
                  # Allow if the default value in the configuration class is different from the one in `PretrainedConfig`
                  if attribute in ["is_encoder_decoder"] and default_value is True:
                        snake_case__       :   str	      =    True
                  elif attribute in ["tie_word_embeddings"] and default_value is False:
                        snake_case__       :   str	      =    True

                  # Allow cases without checking the default value in the configuration class
                  elif attribute in attributes_to_allow + attributes_used_in_generation:
                        snake_case__       :   Optional[Any]	      =    True
                  elif attribute.endswith('_token_id'		):
                        snake_case__       :   List[str]	      =    True

                  # configuration class specific cases
                  if not case_allowed:
                        snake_case__       :   Optional[Any]	      =    SPECIAL_CASES_TO_ALLOW.get(config_class.__name__				,      []		)
                        snake_case__       :   int	      =    allowed_cases is True or attribute in allowed_cases

      return attribute_used or case_allowed






def 		UpperCamelCase__      (		__SCREAMING_SNAKE_CASE		)    ->   List[Any]:
      snake_case__       :   Optional[Any]	      =    dict(inspect.signature(config_class.__init__		).parameters		)
      snake_case__       :   Any	      =    [x for x in list(signature.keys()		) if x not in ['self', 'kwargs']]
      snake_case__       :   int	      =    [signature[param].default for param in parameter_names]

      # If `attribute_map` exists, an attribute can have different names to be used in the modeling files, and as long
      # as one variant is used, the test should pass
      snake_case__       :   Optional[Any]	      =    {}
      if len(config_class.attribute_map		) > 0:
            snake_case__       :   int	      =    {v: k for k, v in config_class.attribute_map.items()}

      # Get the path to modeling source files
      snake_case__       :   Dict	      =    inspect.getsourcefile(__SCREAMING_SNAKE_CASE		)
      snake_case__       :   Optional[int]	      =    os.path.dirname(__SCREAMING_SNAKE_CASE		)
      # Let's check against all frameworks: as long as one framework uses an attribute, we are good.
      snake_case__       :   Optional[Any]	      =    [os.path.join(__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		) for fn in os.listdir(__SCREAMING_SNAKE_CASE		) if fn.startswith('modeling_'		)]

      # Get the source code strings
      snake_case__       :   Any	      =    []
      for path in modeling_paths:
            if os.path.isfile(__SCREAMING_SNAKE_CASE		):
                  with open(__SCREAMING_SNAKE_CASE		) as fp:
                        modeling_sources.append(fp.read()		)

      snake_case__       :   Any	      =    []
      for config_param, default_value in zip(__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		):
            # `attributes` here is all the variant names for `config_param`
            snake_case__       :   Union[str, Any]	      =    [config_param]
            # some configuration classes have non-empty `attribute_map`, and both names could be used in the
            # corresponding modeling files. As long as one of them appears, it is fine.
            if config_param in reversed_attribute_map:
                  attributes.append(reversed_attribute_map[config_param]		)

            if not check_attribute_being_used(__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		):
                  unused_attributes.append(attributes[0]		)

      return sorted(__SCREAMING_SNAKE_CASE		)






def 		UpperCamelCase__      (		)    ->   str:
      snake_case__       :   Optional[int]	      =    {}
      for _config_class in list(CONFIG_MAPPING.values()		):
            # Skip deprecated models
            if "models.deprecated" in _config_class.__module__:
                  continue
            # Some config classes are not in `CONFIG_MAPPING` (e.g. `CLIPVisionConfig`, `Blip2VisionConfig`, etc.)
            snake_case__       :   List[str]	      =    [
                cls
                for name, cls in inspect.getmembers(
                    inspect.getmodule(_config_class		)				,      lambda __SCREAMING_SNAKE_CASE		: inspect.isclass(__SCREAMING_SNAKE_CASE		)
                    and issubclass(__SCREAMING_SNAKE_CASE				,      __SCREAMING_SNAKE_CASE		)
                    and inspect.getmodule(__SCREAMING_SNAKE_CASE		) == inspect.getmodule(_config_class		)				,      )
            ]
            for config_class in config_classes_in_module:
                  snake_case__       :   Union[str, Any]	      =    check_config_attributes_being_used(__SCREAMING_SNAKE_CASE		)
                  if len(__SCREAMING_SNAKE_CASE		) > 0:
                        snake_case__       :   Tuple	      =    unused_attributes

      if len(__SCREAMING_SNAKE_CASE		) > 0:
            snake_case__       :   Tuple	      =    'The following configuration classes contain unused attributes in the corresponding modeling files:\n'
            for name, attributes in configs_with_unused_attributes.items():
                  error += f"{name}: {attributes}\n"

            raise ValueError(__SCREAMING_SNAKE_CASE		)


if __name__ == "__main__":
      check_config_attributes()






'''simple docstring'''






import inspect
import unittest

from transformers import ConvNextConfig
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_backbone_common import BackboneTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
      import torch

      from transformers import ConvNextBackbone, ConvNextForImageClassification, ConvNextModel
      from transformers.models.convnext.modeling_convnext import CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
      from PIL import Image

      from transformers import AutoImageProcessor






class        lowercase_      :





     def __init__(     self     :					Tuple     ,							__lowerCamelCase     :					Optional[Any]     ,							__lowerCamelCase     :					Optional[Any]=13     ,							__lowerCamelCase     :					List[Any]=32     ,							__lowerCamelCase     :					List[str]=3     ,							__lowerCamelCase     :					Any=4     ,							__lowerCamelCase     :					str=[10, 20, 30, 40]     ,							__lowerCamelCase     :					Any=[2, 2, 3, 2]     ,							__lowerCamelCase     :					List[Any]=True     ,							__lowerCamelCase     :					List[Any]=True     ,							__lowerCamelCase     :					List[Any]=37     ,							__lowerCamelCase     :					int="gelu"     ,							__lowerCamelCase     :					List[Any]=10     ,							__lowerCamelCase     :					Tuple=0.0_2     ,							__lowerCamelCase     :					str=["stage2", "stage3", "stage4"]     ,							__lowerCamelCase     :					Optional[Any]=[2, 3, 4]     ,							__lowerCamelCase     :					Dict=None     ,							):
           snake_case__       :   List[str]	      =    parent
           snake_case__       :   Optional[Any]	      =    batch_size
           snake_case__       :   int	      =    image_size
           snake_case__       :   Tuple	      =    num_channels
           snake_case__       :   Any	      =    num_stages
           snake_case__       :   Any	      =    hidden_sizes
           snake_case__       :   Optional[Any]	      =    depths
           snake_case__       :   Optional[Any]	      =    is_training
           snake_case__       :   Dict	      =    use_labels
           snake_case__       :   Any	      =    intermediate_size
           snake_case__       :   int	      =    hidden_act
           snake_case__       :   Any	      =    num_labels
           snake_case__       :   Optional[int]	      =    initializer_range
           snake_case__       :   Union[str, Any]	      =    out_features
           snake_case__       :   Optional[Any]	      =    out_indices
           snake_case__       :   Optional[int]	      =    scope





     def 			_lowerCAmelCase      (     self     :					List[Any]			):
           snake_case__       :   Union[str, Any]	      =    floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]			)

           snake_case__       :   Optional[int]	      =    None
           if self.use_labels:
                 snake_case__       :   Tuple	      =    ids_tensor([self.batch_size]     ,							self.num_labels			)

           snake_case__       :   Any	      =    self.get_config()
           return config, pixel_values, labels





     def 			_lowerCAmelCase      (     self     :					Tuple			):
           return ConvNextConfig(
               num_channels=self.num_channels     ,							hidden_sizes=self.hidden_sizes     ,							depths=self.depths     ,							num_stages=self.num_stages     ,							hidden_act=self.hidden_act     ,							is_decoder=__lowerCamelCase     ,							initializer_range=self.initializer_range     ,							out_features=self.out_features     ,							out_indices=self.out_indices     ,							num_labels=self.num_labels     ,							)





     def 			_lowerCAmelCase      (     self     :					List[Any]     ,							__lowerCamelCase     :					List[str]     ,							__lowerCamelCase     :					Tuple     ,							__lowerCamelCase     :					Tuple			):
           snake_case__       :   Optional[int]	      =    ConvNextModel(config=__lowerCamelCase			)
           model.to(__lowerCamelCase			)
           model.eval()
           snake_case__       :   Union[str, Any]	      =    model(__lowerCamelCase			)
           # expected last hidden states: B, C, H // 32, W // 32
           self.parent.assertEqual(
               result.last_hidden_state.shape     ,							(self.batch_size, self.hidden_sizes[-1], self.image_size // 32, self.image_size // 32)     ,							)





     def 			_lowerCAmelCase      (     self     :					Any     ,							__lowerCamelCase     :					str     ,							__lowerCamelCase     :					str     ,							__lowerCamelCase     :					List[Any]			):
           snake_case__       :   Optional[Any]	      =    ConvNextForImageClassification(__lowerCamelCase			)
           model.to(__lowerCamelCase			)
           model.eval()
           snake_case__       :   Optional[Any]	      =    model(__lowerCamelCase     ,							labels=__lowerCamelCase			)
           self.parent.assertEqual(result.logits.shape     ,							(self.batch_size, self.num_labels)			)





     def 			_lowerCAmelCase      (     self     :					List[str]     ,							__lowerCamelCase     :					int     ,							__lowerCamelCase     :					Dict     ,							__lowerCamelCase     :					int			):
           snake_case__       :   Dict	      =    ConvNextBackbone(config=__lowerCamelCase			)
           model.to(__lowerCamelCase			)
           model.eval()
           snake_case__       :   str	      =    model(__lowerCamelCase			)

           # verify hidden states
           self.parent.assertEqual(len(result.feature_maps			)     ,							len(config.out_features			)			)
           self.parent.assertListEqual(list(result.feature_maps[0].shape			)     ,							[self.batch_size, self.hidden_sizes[1], 4, 4]			)

           # verify channels
           self.parent.assertEqual(len(model.channels			)     ,							len(config.out_features			)			)
           self.parent.assertListEqual(model.channels     ,							config.hidden_sizes[1:]			)

           # verify backbone works with out_features=None
           snake_case__       :   List[str]	      =    None
           snake_case__       :   Union[str, Any]	      =    ConvNextBackbone(config=__lowerCamelCase			)
           model.to(__lowerCamelCase			)
           model.eval()
           snake_case__       :   int	      =    model(__lowerCamelCase			)

           # verify feature maps
           self.parent.assertEqual(len(result.feature_maps			)     ,							1			)
           self.parent.assertListEqual(list(result.feature_maps[0].shape			)     ,							[self.batch_size, self.hidden_sizes[-1], 1, 1]			)

           # verify channels
           self.parent.assertEqual(len(model.channels			)     ,							1			)
           self.parent.assertListEqual(model.channels     ,							[config.hidden_sizes[-1]]			)





     def 			_lowerCAmelCase      (     self     :					Tuple			):
           snake_case__       :   Dict	      =    self.prepare_config_and_inputs()
           snake_case__      ,							snake_case__      ,							snake_case__       :   Optional[Any]	      =    config_and_inputs
           snake_case__       :   Optional[int]	      =    {'pixel_values': pixel_values}
           return config, inputs_dict






@require_torch
class        lowercase_      (						lowerCAmelCase_						,       lowerCAmelCase_						,       unittest.TestCase							):
     A_											=			(
         (
             ConvNextModel,
             ConvNextForImageClassification,
             ConvNextBackbone,
         )
         if is_torch_available()
         else ()
     )
     A_											=			(
         {"feature-extraction": ConvNextModel, "image-classification": ConvNextForImageClassification}
         if is_torch_available()
         else {}
     )

     A_											=			True
     A_											=			False
     A_											=			False
     A_											=			False
     A_											=			False





     def 			_lowerCAmelCase      (     self     :					Any			):
           snake_case__       :   Tuple	      =    ConvNextModelTester(self			)
           snake_case__       :   Optional[int]	      =    ConfigTester(self     ,							config_class=__lowerCamelCase     ,							has_text_modality=__lowerCamelCase     ,							hidden_size=37			)





     def 			_lowerCAmelCase      (     self     :					Optional[Any]			):
           self.create_and_test_config_common_properties()
           self.config_tester.create_and_test_config_to_json_string()
           self.config_tester.create_and_test_config_to_json_file()
           self.config_tester.create_and_test_config_from_and_save_pretrained()
           self.config_tester.create_and_test_config_with_num_labels()
           self.config_tester.check_config_can_be_init_without_params()
           self.config_tester.check_config_arguments_init()





     def 			_lowerCAmelCase      (     self     :					Dict			):
           return





     @unittest.skip(reason='ConvNext does not use inputs_embeds'			)
     def 			_lowerCAmelCase      (     self     :					List[Any]			):
           pass





     @unittest.skip(reason='ConvNext does not support input and output embeddings'			)
     def 			_lowerCAmelCase      (     self     :					Tuple			):
           pass





     @unittest.skip(reason='ConvNext does not use feedforward chunking'			)
     def 			_lowerCAmelCase      (     self     :					List[Any]			):
           pass





     def 			_lowerCAmelCase      (     self     :					str			):
           snake_case__      ,							snake_case__       :   Any	      =    self.model_tester.prepare_config_and_inputs_for_common()

           for model_class in self.all_model_classes:
                 snake_case__       :   Dict	      =    model_class(__lowerCamelCase			)
                 snake_case__       :   Optional[Any]	      =    inspect.signature(model.forward			)
                 # signature.parameters is an OrderedDict => so arg_names order is deterministic
                 snake_case__       :   Optional[Any]	      =    [*signature.parameters.keys()]

                 snake_case__       :   str	      =    ['pixel_values']
                 self.assertListEqual(arg_names[:1]     ,							__lowerCamelCase			)





     def 			_lowerCAmelCase      (     self     :					int			):
           snake_case__       :   List[Any]	      =    self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_model(*__lowerCamelCase			)





     def 			_lowerCAmelCase      (     self     :					int			):
           snake_case__       :   List[Any]	      =    self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_backbone(*__lowerCamelCase			)





     def 			_lowerCAmelCase      (     self     :					str			):
           def check_hidden_states_output(__lowerCamelCase     :					Tuple     ,							__lowerCamelCase     :					Any     ,							__lowerCamelCase     :					Tuple			):
                 snake_case__       :   int	      =    model_class(__lowerCamelCase			)
                 model.to(__lowerCamelCase			)
                 model.eval()

                 with torch.no_grad():
                       snake_case__       :   int	      =    model(**self._prepare_for_class(__lowerCamelCase     ,							__lowerCamelCase			)			)

                 snake_case__       :   Optional[Any]	      =    outputs.encoder_hidden_states if config.is_encoder_decoder else outputs.hidden_states

                 snake_case__       :   Optional[Any]	      =    self.model_tester.num_stages
                 self.assertEqual(len(__lowerCamelCase			)     ,							expected_num_stages + 1			)

                 # ConvNext's feature maps are of shape (batch_size, num_channels, height, width)
                 self.assertListEqual(
                     list(hidden_states[0].shape[-2:]			)     ,							[self.model_tester.image_size // 4, self.model_tester.image_size // 4]     ,							)

           snake_case__      ,							snake_case__       :   List[Any]	      =    self.model_tester.prepare_config_and_inputs_for_common()

           for model_class in self.all_model_classes:
                 snake_case__       :   Dict	      =    True
                 check_hidden_states_output(__lowerCamelCase     ,							__lowerCamelCase     ,							__lowerCamelCase			)

                 # check that output_hidden_states also work using config
                 del inputs_dict["output_hidden_states"]
                 snake_case__       :   Tuple	      =    True

                 check_hidden_states_output(__lowerCamelCase     ,							__lowerCamelCase     ,							__lowerCamelCase			)





     def 			_lowerCAmelCase      (     self     :					List[Any]			):
           snake_case__       :   Any	      =    self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_for_image_classification(*__lowerCamelCase			)





     @slow
     def 			_lowerCAmelCase      (     self     :					str			):
           for model_name in CONVNEXT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                 snake_case__       :   Optional[int]	      =    ConvNextModel.from_pretrained(__lowerCamelCase			)
                 self.assertIsNotNone(__lowerCamelCase			)






def 		UpperCamelCase__      (		)    ->   Optional[Any]:
      snake_case__       :   Any	      =    Image.open('./tests/fixtures/tests_samples/COCO/000000039769.png'		)
      return image






@require_torch
@require_vision
class        lowercase_      (						unittest.TestCase							):





     @cached_property
     def 			_lowerCAmelCase      (     self     :					List[Any]			):
           return AutoImageProcessor.from_pretrained('facebook/convnext-tiny-224'			) if is_vision_available() else None





     @slow
     def 			_lowerCAmelCase      (     self     :					Optional[int]			):
           snake_case__       :   str	      =    ConvNextForImageClassification.from_pretrained('facebook/convnext-tiny-224'			).to(__lowerCamelCase			)

           snake_case__       :   str	      =    self.default_image_processor
           snake_case__       :   List[str]	      =    prepare_img()
           snake_case__       :   List[Any]	      =    image_processor(images=__lowerCamelCase     ,							return_tensors='pt'			).to(__lowerCamelCase			)

           # forward pass
           with torch.no_grad():
                 snake_case__       :   int	      =    model(**__lowerCamelCase			)

           # verify the logits
           snake_case__       :   Tuple	      =    torch.Size((1, 1000)			)
           self.assertEqual(outputs.logits.shape     ,							__lowerCamelCase			)

           snake_case__       :   int	      =    torch.tensor([-0.0_2_6_0, -0.4_7_3_9, 0.1_9_1_1]			).to(__lowerCamelCase			)

           self.assertTrue(torch.allclose(outputs.logits[0, :3]     ,							__lowerCamelCase     ,							atol=1E-4			)			)






@require_torch
class        lowercase_      (						unittest.TestCase						,       lowerCAmelCase_							):
     A_											=			(ConvNextBackbone,) if is_torch_available() else ()
     A_											=			ConvNextConfig

     A_											=			False





     def 			_lowerCAmelCase      (     self     :					List[Any]			):
           snake_case__       :   List[Any]	      =    ConvNextModelTester(self			)
