


"""simple docstring"""







import contextlib
import copy
import random
from typing import Any, Dict, Iterable, Optional, Union

import numpy as np
import torch

from .utils import deprecate, is_transformers_available


if is_transformers_available():
     import transformers
def 					a__			(				SCREAMING_SNAKE_CASE    :    Optional[int]				):


  '''simple docstring'''







  random.seed(SCREAMING_SNAKE_CASE				)
  np.random.seed(SCREAMING_SNAKE_CASE				)
  torch.manual_seed(SCREAMING_SNAKE_CASE				)
  torch.cuda.manual_seed_all(SCREAMING_SNAKE_CASE				)
  # ^^ safe to call this function even if cuda is not available





class       SCREAMING_SNAKE_CASE__				:
       """simple docstring"""


       def __init__(						self		,     snake_case__		,     snake_case__ = 0.9999		,     snake_case__ = 0.0		,     snake_case__ = 0		,     snake_case__ = False		,     snake_case__ = 1.0		,     snake_case__ = 2 / 3		,     snake_case__ = None		,     snake_case__ = None		,     **snake_case__		,     ):






         """simple docstring"""





         if isinstance(_SCREAMING_SNAKE_CASE		,     torch.nn.Module						):
           lowerCAmelCase     :     List[Any]								=							(
               '''Passing a `torch.nn.Module` to `ExponentialMovingAverage` is deprecated. '''
               '''Please pass the parameters of the module instead.'''
           )
           deprecate(
               "passing a `torch.nn.Module` to `ExponentialMovingAverage`"		,     "1.0.0"		,     _SCREAMING_SNAKE_CASE		,     standard_warn=_SCREAMING_SNAKE_CASE		,     )
           lowerCAmelCase     :     Optional[int]								=							parameters.parameters()

           # set use_ema_warmup to True if a torch.nn.Module is passed for backwards compatibility
           lowerCAmelCase     :     Tuple								=							True

         if kwargs.get("max_value"		,     _SCREAMING_SNAKE_CASE						) is not None:
           lowerCAmelCase     :     Union[str, Any]								=							'''The `max_value` argument is deprecated. Please use `decay` instead.'''
           deprecate("max_value"		,     "1.0.0"		,     _SCREAMING_SNAKE_CASE		,     standard_warn=_SCREAMING_SNAKE_CASE						)
           lowerCAmelCase     :     Optional[int]								=							kwargs['''max_value''']

         if kwargs.get("min_value"		,     _SCREAMING_SNAKE_CASE						) is not None:
           lowerCAmelCase     :     Tuple								=							'''The `min_value` argument is deprecated. Please use `min_decay` instead.'''
           deprecate("min_value"		,     "1.0.0"		,     _SCREAMING_SNAKE_CASE		,     standard_warn=_SCREAMING_SNAKE_CASE						)
           lowerCAmelCase     :     Optional[Any]								=							kwargs['''min_value''']

         lowerCAmelCase     :     int								=							list(_SCREAMING_SNAKE_CASE						)
         lowerCAmelCase     :     Optional[Any]								=							[p.clone().detach() for p in parameters]

         if kwargs.get("device"		,     _SCREAMING_SNAKE_CASE						) is not None:
           lowerCAmelCase     :     int								=							'''The `device` argument is deprecated. Please use `to` instead.'''
           deprecate("device"		,     "1.0.0"		,     _SCREAMING_SNAKE_CASE		,     standard_warn=_SCREAMING_SNAKE_CASE						)
           self.to(device=kwargs["device"]						)

         lowerCAmelCase     :     Optional[int]								=							None

         lowerCAmelCase     :     Any								=							decay
         lowerCAmelCase     :     List[str]								=							min_decay
         lowerCAmelCase     :     Any								=							update_after_step
         lowerCAmelCase     :     Tuple								=							use_ema_warmup
         lowerCAmelCase     :     Optional[Any]								=							inv_gamma
         lowerCAmelCase     :     Dict								=							power
         lowerCAmelCase     :     Dict								=							0
         lowerCAmelCase     :     int								=							None  # set in `step()`

         lowerCAmelCase     :     int								=							model_cls
         lowerCAmelCase     :     Dict								=							model_config

       @classmethod
       def        lowercase__							(						cls		,     snake_case__		,     snake_case__						):






         """simple docstring"""





         lowerCAmelCase     :     Union[str, Any]								=							model_cls.load_config(_SCREAMING_SNAKE_CASE		,     return_unused_kwargs=_SCREAMING_SNAKE_CASE						)
         lowerCAmelCase     :     List[str]								=							model_cls.from_pretrained(_SCREAMING_SNAKE_CASE						)

         lowerCAmelCase     :     List[Any]								=							cls(model.parameters()		,     model_cls=_SCREAMING_SNAKE_CASE		,     model_config=model.config						)

         ema_model.load_state_dict(_SCREAMING_SNAKE_CASE						)
         return ema_model

       def        lowercase__							(						self		,     snake_case__						):






         """simple docstring"""





         if self.model_cls is None:
           raise ValueError("`save_pretrained` can only be used if `model_cls` was defined at __init__."						)

         if self.model_config is None:
           raise ValueError("`save_pretrained` can only be used if `model_config` was defined at __init__."						)

         lowerCAmelCase     :     List[str]								=							self.model_cls.from_config(self.model_config						)
         lowerCAmelCase     :     Dict								=							self.state_dict()
         state_dict.pop("shadow_params"		,     _SCREAMING_SNAKE_CASE						)

         model.register_to_config(**_SCREAMING_SNAKE_CASE						)
         self.copy_to(model.parameters()						)
         model.save_pretrained(_SCREAMING_SNAKE_CASE						)

       def        lowercase__							(						self		,     snake_case__						):






         """simple docstring"""





         lowerCAmelCase     :     List[Any]								=							max(0		,     optimization_step - self.update_after_step - 1						)

         if step <= 0:
           return 0.0

         if self.use_ema_warmup:
           lowerCAmelCase     :     Any								=							1 - (1 + step / self.inv_gamma) ** -self.power
         else:
           lowerCAmelCase     :     Union[str, Any]								=							(1 + step) / (10 + step)

         lowerCAmelCase     :     Optional[int]								=							min(_SCREAMING_SNAKE_CASE		,     self.decay						)
         # make sure decay is not smaller than min_decay
         lowerCAmelCase     :     List[str]								=							max(_SCREAMING_SNAKE_CASE		,     self.min_decay						)
         return cur_decay_value

       @torch.no_grad()
       def        lowercase__							(						self		,     snake_case__						):






         """simple docstring"""





         if isinstance(_SCREAMING_SNAKE_CASE		,     torch.nn.Module						):
           lowerCAmelCase     :     Union[str, Any]								=							(
               '''Passing a `torch.nn.Module` to `ExponentialMovingAverage.step` is deprecated. '''
               '''Please pass the parameters of the module instead.'''
           )
           deprecate(
               "passing a `torch.nn.Module` to `ExponentialMovingAverage.step`"		,     "1.0.0"		,     _SCREAMING_SNAKE_CASE		,     standard_warn=_SCREAMING_SNAKE_CASE		,     )
           lowerCAmelCase     :     int								=							parameters.parameters()

         lowerCAmelCase     :     Optional[Any]								=							list(_SCREAMING_SNAKE_CASE						)

         self.optimization_step += 1

         # Compute the decay factor for the exponential moving average.
         lowerCAmelCase     :     Tuple								=							self.get_decay(self.optimization_step						)
         lowerCAmelCase     :     str								=							decay
         lowerCAmelCase     :     List[Any]								=							1 - decay

         lowerCAmelCase     :     int								=							contextlib.nullcontext
         if is_transformers_available() and transformers.deepspeed.is_deepspeed_zeroa_enabled():
           import deepspeed

         for s_param, param in zip(self.shadow_params		,     _SCREAMING_SNAKE_CASE						):
           if is_transformers_available() and transformers.deepspeed.is_deepspeed_zeroa_enabled():
             lowerCAmelCase     :     Optional[Any]								=							deepspeed.zero.GatheredParameters(_SCREAMING_SNAKE_CASE		,     modifier_rank=_SCREAMING_SNAKE_CASE						)

           with context_manager():
             if param.requires_grad:
               s_param.sub_(one_minus_decay * (s_param - param)						)
             else:
               s_param.copy_(_SCREAMING_SNAKE_CASE						)

       def        lowercase__							(						self		,     snake_case__						):






         """simple docstring"""





         lowerCAmelCase     :     List[str]								=							list(_SCREAMING_SNAKE_CASE						)
         for s_param, param in zip(self.shadow_params		,     _SCREAMING_SNAKE_CASE						):
           param.data.copy_(s_param.to(param.device						).data						)

       def        lowercase__							(						self		,     snake_case__=None		,     snake_case__=None						):






         """simple docstring"""





         lowerCAmelCase     :     Any								=							[
             p.to(device=_SCREAMING_SNAKE_CASE		,     dtype=_SCREAMING_SNAKE_CASE						) if p.is_floating_point() else p.to(device=_SCREAMING_SNAKE_CASE						)
             for p in self.shadow_params
         ]

       def        lowercase__							(						self						):






         """simple docstring"""





         return {
             "decay": self.decay,
             "min_decay": self.min_decay,
             "optimization_step": self.optimization_step,
             "update_after_step": self.update_after_step,
             "use_ema_warmup": self.use_ema_warmup,
             "inv_gamma": self.inv_gamma,
             "power": self.power,
             "shadow_params": self.shadow_params,
         }

       def        lowercase__							(						self		,     snake_case__						):






         """simple docstring"""





         lowerCAmelCase     :     Dict								=							[param.detach().cpu().clone() for param in parameters]

       def        lowercase__							(						self		,     snake_case__						):






         """simple docstring"""





         if self.temp_stored_params is None:
           raise RuntimeError("This ExponentialMovingAverage has no `store()`ed weights " "to `restore()`"						)
         for c_param, param in zip(self.temp_stored_params		,     _SCREAMING_SNAKE_CASE						):
           param.data.copy_(c_param.data						)

         # Better memory-wise.
         lowerCAmelCase     :     Tuple								=							None







       def        lowercase__							(						self		,     snake_case__						):






         """simple docstring"""





         lowerCAmelCase     :     int								=							copy.deepcopy(_SCREAMING_SNAKE_CASE						)

         lowerCAmelCase     :     List[Any]								=							state_dict.get("decay"		,     self.decay						)
         if self.decay < 0.0 or self.decay > 1.0:
           raise ValueError("Decay must be between 0 and 1"						)

         lowerCAmelCase     :     List[str]								=							state_dict.get("min_decay"		,     self.min_decay						)
         if not isinstance(self.min_decay		,     _SCREAMING_SNAKE_CASE						):
           raise ValueError("Invalid min_decay"						)

         lowerCAmelCase     :     Union[str, Any]								=							state_dict.get("optimization_step"		,     self.optimization_step						)
         if not isinstance(self.optimization_step		,     _SCREAMING_SNAKE_CASE						):
           raise ValueError("Invalid optimization_step"						)

         lowerCAmelCase     :     Tuple								=							state_dict.get("update_after_step"		,     self.update_after_step						)
         if not isinstance(self.update_after_step		,     _SCREAMING_SNAKE_CASE						):
           raise ValueError("Invalid update_after_step"						)

         lowerCAmelCase     :     Optional[int]								=							state_dict.get("use_ema_warmup"		,     self.use_ema_warmup						)
         if not isinstance(self.use_ema_warmup		,     _SCREAMING_SNAKE_CASE						):
           raise ValueError("Invalid use_ema_warmup"						)

         lowerCAmelCase     :     Tuple								=							state_dict.get("inv_gamma"		,     self.inv_gamma						)
         if not isinstance(self.inv_gamma		,     (float, int)						):
           raise ValueError("Invalid inv_gamma"						)

         lowerCAmelCase     :     int								=							state_dict.get("power"		,     self.power						)
         if not isinstance(self.power		,     (float, int)						):
           raise ValueError("Invalid power"						)

         lowerCAmelCase     :     List[str]								=							state_dict.get("shadow_params"		,     _SCREAMING_SNAKE_CASE						)
         if shadow_params is not None:
           lowerCAmelCase     :     Any								=							shadow_params
           if not isinstance(self.shadow_params		,     _SCREAMING_SNAKE_CASE						):
             raise ValueError("shadow_params must be a list"						)
           if not all(isinstance(_SCREAMING_SNAKE_CASE		,     torch.Tensor						) for p in self.shadow_params						):
             raise ValueError("shadow_params must all be Tensors"						)









import inspect
import unittest

from transformers import RegNetConfig
from transformers.file_utils import cached_property, is_torch_available, is_vision_available
from transformers.testing_utils import require_torch, require_vision, slow, torch_device

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 torch import nn

     from transformers import RegNetForImageClassification, RegNetModel
     from transformers.models.regnet.modeling_regnet import REGNET_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
     from PIL import Image

     from transformers import AutoImageProcessor






class   _lowerCamelCase :




       """simple docstring"""



       def __init__(      self				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE=3				,       _SCREAMING_SNAKE_CASE=32				,       _SCREAMING_SNAKE_CASE=3				,       _SCREAMING_SNAKE_CASE=10				,       _SCREAMING_SNAKE_CASE=[10, 20, 30, 40]				,       _SCREAMING_SNAKE_CASE=[1, 1, 2, 1]				,       _SCREAMING_SNAKE_CASE=True				,       _SCREAMING_SNAKE_CASE=True				,       _SCREAMING_SNAKE_CASE="relu"				,       _SCREAMING_SNAKE_CASE=3				,       _SCREAMING_SNAKE_CASE=None				,       )->List[str]:




         '''simple docstring'''





         A_      :				str		     =					parent
         A_      :				int		     =					batch_size
         A_      :				List[str]		     =					image_size
         A_      :				Dict		     =					num_channels
         A_      :				Tuple		     =					embeddings_size
         A_      :				Union[str, Any]		     =					hidden_sizes
         A_      :				Dict		     =					depths
         A_      :				str		     =					is_training
         A_      :				Union[str, Any]		     =					use_labels
         A_      :				Union[str, Any]		     =					hidden_act
         A_      :				Optional[Any]		     =					num_labels
         A_      :				Tuple		     =					scope
         A_      :				Optional[int]		     =					len(_SCREAMING_SNAKE_CASE		)



       def        _snake_case       (      self		)->Optional[Any]:




         '''simple docstring'''





         A_      :				List[str]		     =					floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]		)

         A_      :				str		     =					None
         if self.use_labels:
           A_      :				Union[str, Any]		     =					ids_tensor([self.batch_size]				,       self.num_labels		)

         A_      :				Optional[Any]		     =					self.get_config()

         return config, pixel_values, labels



       def        _snake_case       (      self		)->Union[str, Any]:




         '''simple docstring'''





         return RegNetConfig(
             num_channels=self.num_channels				,       embeddings_size=self.embeddings_size				,       hidden_sizes=self.hidden_sizes				,       depths=self.depths				,       hidden_act=self.hidden_act				,       num_labels=self.num_labels				,       )



       def        _snake_case       (      self				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE		)->Union[str, Any]:




         '''simple docstring'''





         A_      :				Dict		     =					RegNetModel(config=_SCREAMING_SNAKE_CASE		)
         model.to(_SCREAMING_SNAKE_CASE		)
         model.eval()
         A_      :				Any		     =					model(_SCREAMING_SNAKE_CASE		)
         # 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        _snake_case       (      self				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE		)->Union[str, Any]:




         '''simple docstring'''





         A_      :				Union[str, Any]		     =					self.num_labels
         A_      :				Dict		     =					RegNetForImageClassification(_SCREAMING_SNAKE_CASE		)
         model.to(_SCREAMING_SNAKE_CASE		)
         model.eval()
         A_      :				int		     =					model(_SCREAMING_SNAKE_CASE				,       labels=_SCREAMING_SNAKE_CASE		)
         self.parent.assertEqual(result.logits.shape				,       (self.batch_size, self.num_labels)		)







       def        _snake_case       (      self		)->Union[str, Any]:




         '''simple docstring'''





         A_      :				Tuple		     =					self.prepare_config_and_inputs()
         A_     ,       A_     ,       A_      :				str		     =					config_and_inputs
         A_      :				Any		     =					{'''pixel_values''': pixel_values}
         return config, inputs_dict






@require_torch
class   _lowerCamelCase (					UpperCamelCase					,							UpperCamelCase					,							unittest.TestCase			):




       """simple docstring"""
       snake_case      =    (RegNetModel, RegNetForImageClassification) if is_torch_available() else ()
       snake_case      =    (
           {"feature-extraction": RegNetModel, "image-classification": RegNetForImageClassification}
           if is_torch_available()
           else {}
       )

       snake_case      =    False
       snake_case      =    False
       snake_case      =    False
       snake_case      =    False



       def        _snake_case       (      self		)->Union[str, Any]:




         '''simple docstring'''





         A_      :				Union[str, Any]		     =					RegNetModelTester(self		)
         A_      :				Union[str, Any]		     =					ConfigTester(self				,       config_class=_SCREAMING_SNAKE_CASE				,       has_text_modality=_SCREAMING_SNAKE_CASE		)



       def        _snake_case       (      self		)->Dict:




         '''simple docstring'''





         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        _snake_case       (      self		)->Tuple:




         '''simple docstring'''





         return



       @unittest.skip(reason='''RegNet does not use inputs_embeds'''		)
       def        _snake_case       (      self		)->Dict:




         '''simple docstring'''





         pass



       @unittest.skip(reason='''RegNet does not support input and output embeddings'''		)
       def        _snake_case       (      self		)->str:




         '''simple docstring'''





         pass



       def        _snake_case       (      self		)->List[Any]:




         '''simple docstring'''





         A_     ,       A_      :				Optional[Any]		     =					self.model_tester.prepare_config_and_inputs_for_common()

         for model_class in self.all_model_classes:
           A_      :				str		     =					model_class(_SCREAMING_SNAKE_CASE		)
           A_      :				Union[str, Any]		     =					inspect.signature(model.forward		)
           # signature.parameters is an OrderedDict => so arg_names order is deterministic
           A_      :				Any		     =					[*signature.parameters.keys()]

           A_      :				Any		     =					['''pixel_values''']
           self.assertListEqual(arg_names[:1]				,       _SCREAMING_SNAKE_CASE		)



       def        _snake_case       (      self		)->Any:




         '''simple docstring'''





         A_      :				Dict		     =					self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_model(*_SCREAMING_SNAKE_CASE		)



       def        _snake_case       (      self		)->Optional[Any]:




         '''simple docstring'''





         A_     ,       A_      :				int		     =					self.model_tester.prepare_config_and_inputs_for_common()

         for model_class in self.all_model_classes:
           A_      :				Union[str, Any]		     =					model_class(config=_SCREAMING_SNAKE_CASE		)
           for name, module in model.named_modules():
             if isinstance(_SCREAMING_SNAKE_CASE				,       (nn.BatchNormad, nn.GroupNorm)		):
               self.assertTrue(
                   torch.all(module.weight == 1		)				,       msg=F'''Parameter {name} of model {model_class} seems not properly initialized'''				,       )
               self.assertTrue(
                   torch.all(module.bias == 0		)				,       msg=F'''Parameter {name} of model {model_class} seems not properly initialized'''				,       )



       def        _snake_case       (      self		)->List[Any]:




         '''simple docstring'''





         def check_hidden_states_output(_SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE		):
           A_      :				str		     =					model_class(_SCREAMING_SNAKE_CASE		)
           model.to(_SCREAMING_SNAKE_CASE		)
           model.eval()

           with torch.no_grad():
             A_      :				Tuple		     =					model(**self._prepare_for_class(_SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE		)		)

           A_      :				Union[str, Any]		     =					outputs.encoder_hidden_states if config.is_encoder_decoder else outputs.hidden_states

           A_      :				Optional[int]		     =					self.model_tester.num_stages
           self.assertEqual(len(_SCREAMING_SNAKE_CASE		)				,       expected_num_stages + 1		)

           # RegNet'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 // 2, self.model_tester.image_size // 2]				,       )

         A_     ,       A_      :				Tuple		     =					self.model_tester.prepare_config_and_inputs_for_common()
         A_      :				int		     =					['''basic''', '''bottleneck''']
         for model_class in self.all_model_classes:
           for layer_type in layers_type:
             A_      :				int		     =					layer_type
             A_      :				List[Any]		     =					True
             check_hidden_states_output(_SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE		)

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

             check_hidden_states_output(_SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE				,       _SCREAMING_SNAKE_CASE		)



       def        _snake_case       (      self		)->Dict:




         '''simple docstring'''





         A_      :				List[str]		     =					self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_image_classification(*_SCREAMING_SNAKE_CASE		)







       @slow
       def        _snake_case       (      self		)->str:




         '''simple docstring'''





         for model_name in REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
           A_      :				Dict		     =					RegNetModel.from_pretrained(_SCREAMING_SNAKE_CASE		)
           self.assertIsNotNone(_SCREAMING_SNAKE_CASE		)




def   _SCREAMING_SNAKE_CASE	( ):
  A_      :				int		     =					Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png'''       )
  return image







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




       """simple docstring"""



       @cached_property
       def        _snake_case       (      self		)->List[str]:




         '''simple docstring'''





         return (
             AutoImageProcessor.from_pretrained(REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]		)
             if is_vision_available()
             else None
         )







       @slow
       def        _snake_case       (      self		)->Tuple:




         '''simple docstring'''





         A_      :				List[Any]		     =					RegNetForImageClassification.from_pretrained(REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]		).to(_SCREAMING_SNAKE_CASE		)

         A_      :				Optional[Any]		     =					self.default_image_processor
         A_      :				Any		     =					prepare_img()
         A_      :				Optional[Any]		     =					image_processor(images=_SCREAMING_SNAKE_CASE				,       return_tensors='''pt'''		).to(_SCREAMING_SNAKE_CASE		)

         # forward pass
         with torch.no_grad():
           A_      :				Union[str, Any]		     =					model(**_SCREAMING_SNAKE_CASE		)

         # verify the logits
         A_      :				Union[str, Any]		     =					torch.Size((1, 1000)		)
         self.assertEqual(outputs.logits.shape				,       _SCREAMING_SNAKE_CASE		)

         A_      :				Optional[int]		     =					torch.tensor([-0.4_1_8_0, -1.5_0_5_1, -3.4_8_3_6]		).to(_SCREAMING_SNAKE_CASE		)

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




