




_snake_case				:				str       							=		[
    999,
    800,
    799,
    600,
    599,
    500,
    400,
    399,
    377,
    355,
    333,
    311,
    288,
    266,
    244,
    222,
    200,
    199,
    177,
    155,
    133,
    111,
    88,
    66,
    44,
    22,
    0,
]

_snake_case				:				Optional[int]       							=		[
    999,
    976,
    952,
    928,
    905,
    882,
    858,
    857,
    810,
    762,
    715,
    714,
    572,
    429,
    428,
    286,
    285,
    238,
    190,
    143,
    142,
    118,
    95,
    71,
    47,
    24,
    0,
]

_snake_case				:				Optional[int]       							=		[
    999,
    988,
    977,
    966,
    955,
    944,
    933,
    922,
    911,
    900,
    899,
    879,
    859,
    840,
    820,
    800,
    799,
    766,
    733,
    700,
    699,
    650,
    600,
    599,
    500,
    499,
    400,
    399,
    350,
    300,
    299,
    266,
    233,
    200,
    199,
    179,
    159,
    140,
    120,
    100,
    99,
    88,
    77,
    66,
    55,
    44,
    33,
    22,
    11,
    0,
]

_snake_case				:				List[str]       							=		[
    999,
    995,
    992,
    989,
    985,
    981,
    978,
    975,
    971,
    967,
    964,
    961,
    957,
    956,
    951,
    947,
    942,
    937,
    933,
    928,
    923,
    919,
    914,
    913,
    908,
    903,
    897,
    892,
    887,
    881,
    876,
    871,
    870,
    864,
    858,
    852,
    846,
    840,
    834,
    828,
    827,
    820,
    813,
    806,
    799,
    792,
    785,
    784,
    777,
    770,
    763,
    756,
    749,
    742,
    741,
    733,
    724,
    716,
    707,
    699,
    698,
    688,
    677,
    666,
    656,
    655,
    645,
    634,
    623,
    613,
    612,
    598,
    584,
    570,
    569,
    555,
    541,
    527,
    526,
    505,
    484,
    483,
    462,
    440,
    439,
    396,
    395,
    352,
    351,
    308,
    307,
    264,
    263,
    220,
    219,
    176,
    132,
    88,
    44,
    0,
]

_snake_case				:				Optional[Any]       							=		[
    999,
    997,
    995,
    992,
    990,
    988,
    986,
    984,
    981,
    979,
    977,
    975,
    972,
    970,
    968,
    966,
    964,
    961,
    959,
    957,
    956,
    954,
    951,
    949,
    946,
    944,
    941,
    939,
    936,
    934,
    931,
    929,
    926,
    924,
    921,
    919,
    916,
    914,
    913,
    910,
    907,
    905,
    902,
    899,
    896,
    893,
    891,
    888,
    885,
    882,
    879,
    877,
    874,
    871,
    870,
    867,
    864,
    861,
    858,
    855,
    852,
    849,
    846,
    843,
    840,
    837,
    834,
    831,
    828,
    827,
    824,
    821,
    817,
    814,
    811,
    808,
    804,
    801,
    798,
    795,
    791,
    788,
    785,
    784,
    780,
    777,
    774,
    770,
    766,
    763,
    760,
    756,
    752,
    749,
    746,
    742,
    741,
    737,
    733,
    730,
    726,
    722,
    718,
    714,
    710,
    707,
    703,
    699,
    698,
    694,
    690,
    685,
    681,
    677,
    673,
    669,
    664,
    660,
    656,
    655,
    650,
    646,
    641,
    636,
    632,
    627,
    622,
    618,
    613,
    612,
    607,
    602,
    596,
    591,
    586,
    580,
    575,
    570,
    569,
    563,
    557,
    551,
    545,
    539,
    533,
    527,
    526,
    519,
    512,
    505,
    498,
    491,
    484,
    483,
    474,
    466,
    457,
    449,
    440,
    439,
    428,
    418,
    407,
    396,
    395,
    381,
    366,
    352,
    351,
    330,
    308,
    307,
    286,
    264,
    263,
    242,
    220,
    219,
    176,
    175,
    132,
    131,
    88,
    44,
    0,
]

_snake_case				:				Optional[Any]       							=		[
    999,
    991,
    982,
    974,
    966,
    958,
    950,
    941,
    933,
    925,
    916,
    908,
    900,
    899,
    874,
    850,
    825,
    800,
    799,
    700,
    600,
    500,
    400,
    300,
    200,
    100,
    0,
]

_snake_case				:				Any       							=		[
    999,
    992,
    985,
    978,
    971,
    964,
    957,
    949,
    942,
    935,
    928,
    921,
    914,
    907,
    900,
    899,
    879,
    859,
    840,
    820,
    800,
    799,
    766,
    733,
    700,
    699,
    650,
    600,
    599,
    500,
    499,
    400,
    399,
    300,
    299,
    200,
    199,
    100,
    99,
    0,
]

_snake_case				:				int       							=		[
    999,
    996,
    992,
    989,
    985,
    982,
    979,
    975,
    972,
    968,
    965,
    961,
    958,
    955,
    951,
    948,
    944,
    941,
    938,
    934,
    931,
    927,
    924,
    920,
    917,
    914,
    910,
    907,
    903,
    900,
    899,
    891,
    884,
    876,
    869,
    861,
    853,
    846,
    838,
    830,
    823,
    815,
    808,
    800,
    799,
    788,
    777,
    766,
    755,
    744,
    733,
    722,
    711,
    700,
    699,
    688,
    677,
    666,
    655,
    644,
    633,
    622,
    611,
    600,
    599,
    585,
    571,
    557,
    542,
    528,
    514,
    500,
    499,
    485,
    471,
    457,
    442,
    428,
    414,
    400,
    399,
    379,
    359,
    340,
    320,
    300,
    299,
    279,
    259,
    240,
    220,
    200,
    199,
    166,
    133,
    100,
    99,
    66,
    33,
    0,
]







'''simple docstring'''


import copy
import inspect
import unittest

import numpy as np
from huggingface_hub import hf_hub_download

from transformers import VideoMAEConfig
from transformers.models.auto import get_values
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_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 (
				    MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING,
				    VideoMAEForPreTraining,
				    VideoMAEForVideoClassification,
				    VideoMAEModel,
				)
				from transformers.models.videomae.modeling_videomae import VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
				from transformers import VideoMAEImageProcessor

class       A   :







							def __init__(  self	:  Any							,      lowerCAmelCase_	:  List[Any]							,      lowerCAmelCase_	:  List[str]=13							,      lowerCAmelCase_	:  Optional[Any]=10							,      lowerCAmelCase_	:  Optional[int]=3							,      lowerCAmelCase_	:  Union[str, Any]=2							,      lowerCAmelCase_	:  Tuple=2							,      lowerCAmelCase_	:  Dict=2							,      lowerCAmelCase_	:  str=True							,      lowerCAmelCase_	:  Optional[Any]=True							,      lowerCAmelCase_	:  Dict=32							,      lowerCAmelCase_	:  Tuple=5							,      lowerCAmelCase_	:  Optional[int]=4							,      lowerCAmelCase_	:  int=37							,      lowerCAmelCase_	:  int="gelu"							,      lowerCAmelCase_	:  List[str]=0.1							,      lowerCAmelCase_	:  str=0.1							,      lowerCAmelCase_	:  Dict=10							,      lowerCAmelCase_	:  int=0.0_2							,      lowerCAmelCase_	:  Union[str, Any]=0.9							,      lowerCAmelCase_	:  str=None							,      )      ->							int:


														"""simple docstring"""


														_a     					=    parent
														_a     					=    batch_size
														_a     					=    image_size
														_a     					=    num_channels
														_a     					=    patch_size
														_a     					=    tubelet_size
														_a     					=    num_frames
														_a     					=    is_training
														_a     					=    use_labels
														_a     					=    hidden_size
														_a     					=    num_hidden_layers
														_a     					=    num_attention_heads
														_a     					=    intermediate_size
														_a     					=    hidden_act
														_a     					=    hidden_dropout_prob
														_a     					=    attention_probs_dropout_prob
														_a     					=    type_sequence_label_size
														_a     					=    initializer_range
														_a     					=    mask_ratio
														_a     					=    scope

														# in VideoMAE, the number of tokens equals num_frames/tubelet_size * num_patches per frame
														_a     					=    (image_size // patch_size) ** 2
														_a     					=    (num_frames // tubelet_size) * self.num_patches_per_frame

														# use this variable to define bool_masked_pos
														_a     					=    int(mask_ratio * self.seq_length )







							def        __lowerCAmelCase      (  self	:  Any )      ->							Optional[int]:


														"""simple docstring"""


														_a     					=    floats_tensor(
														    [self.batch_size, self.num_frames, self.num_channels, self.image_size, self.image_size] )

														_a     					=    None
														if self.use_labels:
																					_a     					=    ids_tensor([self.batch_size]							,      self.type_sequence_label_size )

														_a     					=    self.get_config()

														return config, pixel_values, labels







							def        __lowerCAmelCase      (  self	:  List[str] )      ->							Any:


														"""simple docstring"""


														return VideoMAEConfig(
														    image_size=self.image_size							,      patch_size=self.patch_size							,      num_channels=self.num_channels							,      num_frames=self.num_frames							,      tubelet_size=self.tubelet_size							,      hidden_size=self.hidden_size							,      num_hidden_layers=self.num_hidden_layers							,      num_attention_heads=self.num_attention_heads							,      intermediate_size=self.intermediate_size							,      hidden_act=self.hidden_act							,      hidden_dropout_prob=self.hidden_dropout_prob							,      attention_probs_dropout_prob=self.attention_probs_dropout_prob							,      is_decoder=lowerCAmelCase_							,      initializer_range=self.initializer_range							,      )







							def        __lowerCAmelCase      (  self	:  List[str]							,      lowerCAmelCase_	:  Optional[Any]							,      lowerCAmelCase_	:  Optional[Any]							,      lowerCAmelCase_	:  Union[str, Any] )      ->							Optional[int]:


														"""simple docstring"""


														_a     					=    VideoMAEModel(config=lowerCAmelCase_ )
														model.to(lowerCAmelCase_ )
														model.eval()
														_a     					=    model(lowerCAmelCase_ )
														self.parent.assertEqual(result.last_hidden_state.shape							,      (self.batch_size, self.seq_length, self.hidden_size) )







							def        __lowerCAmelCase      (  self	:  Any							,      lowerCAmelCase_	:  Optional[int]							,      lowerCAmelCase_	:  Dict							,      lowerCAmelCase_	:  Optional[Any] )      ->							Optional[Any]:


														"""simple docstring"""


														_a     					=    VideoMAEForPreTraining(lowerCAmelCase_ )
														model.to(lowerCAmelCase_ )
														model.eval()
														# important: each video needs to have the same number of masked patches
														# hence we define a single mask, which we then repeat for each example in the batch
														_a     					=    torch.ones((self.num_masks,) )
														_a     					=    torch.cat([mask, torch.zeros(self.seq_length - mask.size(0 ) )] )
														_a     					=    mask.expand(self.batch_size							,      -1 ).bool()

														_a     					=    model(lowerCAmelCase_							,      lowerCAmelCase_ )
														# model only returns predictions for masked patches
														_a     					=    mask.sum().item()
														_a     					=    3 * self.tubelet_size * self.patch_size**2
														self.parent.assertEqual(result.logits.shape							,      (self.batch_size, num_masked_patches, decoder_num_labels) )







							def        __lowerCAmelCase      (  self	:  Optional[Any] )      ->							Optional[int]:


														"""simple docstring"""


														_a     					=    self.prepare_config_and_inputs()
														_a					,							_a					,							_a     					=    config_and_inputs
														_a     					=    {'''pixel_values''': pixel_values}
														return config, inputs_dict



@require_torch
class       A   (		_a					,_a					,unittest.TestCase   ):
							lowercase_          =    (
							    (VideoMAEModel, VideoMAEForPreTraining, VideoMAEForVideoClassification) if is_torch_available() else ()
							)
							lowercase_          =    (
							    {'feature-extraction': VideoMAEModel, 'video-classification': VideoMAEForVideoClassification}
							    if is_torch_available()
							    else {}
							)

							lowercase_          =    False
							lowercase_          =    False
							lowercase_          =    False
							lowercase_          =    False







							def        __lowerCAmelCase      (  self	:  Dict )      ->							int:


														"""simple docstring"""


														_a     					=    VideoMAEModelTester(self )
														_a     					=    ConfigTester(self							,      config_class=lowerCAmelCase_							,      has_text_modality=lowerCAmelCase_							,      hidden_size=37 )







							def        __lowerCAmelCase      (  self	:  Optional[int]							,      lowerCAmelCase_	:  Any							,      lowerCAmelCase_	:  int							,      lowerCAmelCase_	:  List[Any]=False )      ->							Tuple:


														"""simple docstring"""


														_a     					=    copy.deepcopy(lowerCAmelCase_ )

														if model_class == VideoMAEForPreTraining:
																					# important: each video needs to have the same number of masked patches
																					# hence we define a single mask, which we then repeat for each example in the batch
																					_a     					=    torch.ones((self.model_tester.num_masks,) )
																					_a     					=    torch.cat([mask, torch.zeros(self.model_tester.seq_length - mask.size(0 ) )] )
																					_a     					=    mask.expand(self.model_tester.batch_size							,      -1 ).bool()
																					_a     					=    bool_masked_pos.to(lowerCAmelCase_ )

														if return_labels:
																					if model_class in [
																					    *get_values(lowerCAmelCase_ ),
																					]:
																												_a     					=    torch.zeros(
																												    self.model_tester.batch_size							,      dtype=torch.long							,      device=lowerCAmelCase_ )

														return inputs_dict







							def        __lowerCAmelCase      (  self	:  List[Any] )      ->							Optional[int]:


														"""simple docstring"""


														self.config_tester.run_common_tests()







							@unittest.skip(reason='''VideoMAE does not use inputs_embeds''' )
							def        __lowerCAmelCase      (  self	:  Any )      ->							Any:


														"""simple docstring"""


														pass







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


														"""simple docstring"""


														_a					,							_a     					=    self.model_tester.prepare_config_and_inputs_for_common()

														for model_class in self.all_model_classes:
																					_a     					=    model_class(lowerCAmelCase_ )
																					self.assertIsInstance(model.get_input_embeddings()							,      (nn.Module) )
																					_a     					=    model.get_output_embeddings()
																					self.assertTrue(x is None or isinstance(lowerCAmelCase_							,      nn.Linear ) )







							def        __lowerCAmelCase      (  self	:  Any )      ->							Any:


														"""simple docstring"""


														_a					,							_a     					=    self.model_tester.prepare_config_and_inputs_for_common()

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

																					_a     					=    ['''pixel_values''']
																					self.assertListEqual(arg_names[:1]							,      lowerCAmelCase_ )







							def        __lowerCAmelCase      (  self	:  int )      ->							Any:


														"""simple docstring"""


														_a     					=    self.model_tester.prepare_config_and_inputs()
														self.model_tester.create_and_check_model(*lowerCAmelCase_ )







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


														"""simple docstring"""


														_a     					=    self.model_tester.prepare_config_and_inputs()
														self.model_tester.create_and_check_for_pretraining(*lowerCAmelCase_ )







							@slow
							def        __lowerCAmelCase      (  self	:  Dict )      ->							Optional[int]:


														"""simple docstring"""


														for model_name in VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
																					_a     					=    VideoMAEModel.from_pretrained(lowerCAmelCase_ )
																					self.assertIsNotNone(lowerCAmelCase_ )







							def        __lowerCAmelCase      (  self	:  int )      ->							Any:


														"""simple docstring"""


														if not self.has_attentions:
																					pass

														else:
																					_a					,							_a     					=    self.model_tester.prepare_config_and_inputs_for_common()
																					_a     					=    True

																					for model_class in self.all_model_classes:
																												_a     					=    self.model_tester.seq_length - self.model_tester.num_masks
																												_a     					=    (
																												    num_visible_patches if model_class == VideoMAEForPreTraining else self.model_tester.seq_length
																												)

																												_a     					=    True
																												_a     					=    False
																												_a     					=    True
																												_a     					=    model_class(lowerCAmelCase_ )
																												model.to(lowerCAmelCase_ )
																												model.eval()
																												with torch.no_grad():
																																			_a     					=    model(**self._prepare_for_class(lowerCAmelCase_							,      lowerCAmelCase_ ) )
																												_a     					=    outputs.attentions
																												self.assertEqual(len(lowerCAmelCase_ )							,      self.model_tester.num_hidden_layers )

																												# check that output_attentions also work using config
																												del inputs_dict["output_attentions"]
																												_a     					=    True
																												_a     					=    model_class(lowerCAmelCase_ )
																												model.to(lowerCAmelCase_ )
																												model.eval()
																												with torch.no_grad():
																																			_a     					=    model(**self._prepare_for_class(lowerCAmelCase_							,      lowerCAmelCase_ ) )
																												_a     					=    outputs.attentions
																												self.assertEqual(len(lowerCAmelCase_ )							,      self.model_tester.num_hidden_layers )

																												self.assertListEqual(
																												    list(attentions[0].shape[-3:] )							,      [self.model_tester.num_attention_heads, seq_len, seq_len]							,      )
																												_a     					=    len(lowerCAmelCase_ )

																												# Check attention is always last and order is fine
																												_a     					=    True
																												_a     					=    True
																												_a     					=    model_class(lowerCAmelCase_ )
																												model.to(lowerCAmelCase_ )
																												model.eval()
																												with torch.no_grad():
																																			_a     					=    model(**self._prepare_for_class(lowerCAmelCase_							,      lowerCAmelCase_ ) )

																												self.assertEqual(out_len + 1							,      len(lowerCAmelCase_ ) )

																												_a     					=    outputs.attentions

																												self.assertEqual(len(lowerCAmelCase_ )							,      self.model_tester.num_hidden_layers )
																												self.assertListEqual(
																												    list(self_attentions[0].shape[-3:] )							,      [self.model_tester.num_attention_heads, seq_len, seq_len]							,      )







							def        __lowerCAmelCase      (  self	:  Tuple )      ->							Tuple:


														"""simple docstring"""


														def check_hidden_states_output(lowerCAmelCase_	:  str							,      lowerCAmelCase_	:  List[Any]							,      lowerCAmelCase_	:  Tuple ):
																					_a     					=    model_class(lowerCAmelCase_ )
																					model.to(lowerCAmelCase_ )
																					model.eval()

																					with torch.no_grad():
																												_a     					=    model(**self._prepare_for_class(lowerCAmelCase_							,      lowerCAmelCase_ ) )

																					_a     					=    outputs.hidden_states
																					_a     					=    self.model_tester.num_hidden_layers + 1
																					self.assertEqual(len(lowerCAmelCase_ )							,      lowerCAmelCase_ )

																					_a     					=    self.model_tester.seq_length - self.model_tester.num_masks
																					_a     					=    num_visible_patches if model_class == VideoMAEForPreTraining else self.model_tester.seq_length

																					self.assertListEqual(
																					    list(hidden_states[0].shape[-2:] )							,      [seq_length, self.model_tester.hidden_size]							,      )

														_a					,							_a     					=    self.model_tester.prepare_config_and_inputs_for_common()

														for model_class in self.all_model_classes:
																					_a     					=    True
																					check_hidden_states_output(lowerCAmelCase_							,      lowerCAmelCase_							,      lowerCAmelCase_ )

																					# check that output_hidden_states also work using config
																					del inputs_dict["output_hidden_states"]
																					_a     					=    True

																					check_hidden_states_output(lowerCAmelCase_							,      lowerCAmelCase_							,      lowerCAmelCase_ )







							@unittest.skip('''Will be fixed soon by reducing the size of the model used for common tests.''' )
							def        __lowerCAmelCase      (  self	:  Optional[int] )      ->							Dict:


														"""simple docstring"""


														pass



def 		snake_case_   ():





							'''simple docstring'''


							_a     					=    hf_hub_download(
							    repo_id='''hf-internal-testing/spaghetti-video'''			,						filename='''eating_spaghetti.npy'''			,						repo_type='''dataset'''				)
							_a     					=    np.load(UpperCamelCase				)
							return list(UpperCamelCase				)

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







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


														"""simple docstring"""


														return (
														    VideoMAEImageProcessor(image_mean=[0.5, 0.5, 0.5]							,      image_std=[0.5, 0.5, 0.5] )
														    if is_vision_available()
														    else None
														)







							@slow
							def        __lowerCAmelCase      (  self	:  Dict )      ->							Dict:


														"""simple docstring"""


														_a     					=    VideoMAEForVideoClassification.from_pretrained('''MCG-NJU/videomae-base-finetuned-kinetics''' ).to(
														    lowerCAmelCase_ )

														_a     					=    self.default_image_processor
														_a     					=    prepare_video()
														_a     					=    image_processor(lowerCAmelCase_							,      return_tensors='''pt''' ).to(lowerCAmelCase_ )

														# forward pass
														with torch.no_grad():
																					_a     					=    model(**lowerCAmelCase_ )

														# verify the logits
														_a     					=    torch.Size((1, 4_00) )
														self.assertEqual(outputs.logits.shape							,      lowerCAmelCase_ )

														_a     					=    torch.tensor([0.3_6_6_9, -0.0_6_8_8, -0.2_4_2_1] ).to(lowerCAmelCase_ )

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







							@slow
							def        __lowerCAmelCase      (  self	:  Optional[Any] )      ->							Optional[Any]:


														"""simple docstring"""


														_a     					=    VideoMAEForPreTraining.from_pretrained('''MCG-NJU/videomae-base-short''' ).to(lowerCAmelCase_ )

														_a     					=    self.default_image_processor
														_a     					=    prepare_video()
														_a     					=    image_processor(lowerCAmelCase_							,      return_tensors='''pt''' ).to(lowerCAmelCase_ )

														# add boolean mask, indicating which patches to mask
														_a     					=    hf_hub_download(repo_id='''hf-internal-testing/bool-masked-pos'''							,      filename='''bool_masked_pos.pt''' )
														_a     					=    torch.load(lowerCAmelCase_ )

														# forward pass
														with torch.no_grad():
																					_a     					=    model(**lowerCAmelCase_ )

														# verify the logits
														_a     					=    torch.Size([1, 14_08, 15_36] )
														_a     					=    torch.tensor(
														    [[0.7_9_9_4, 0.9_6_1_2, 0.8_5_0_8], [0.7_4_0_1, 0.8_9_5_8, 0.8_3_0_2], [0.5_8_6_2, 0.7_4_6_8, 0.7_3_2_5]]							,      device=lowerCAmelCase_ )
														self.assertEqual(outputs.logits.shape							,      lowerCAmelCase_ )
														self.assertTrue(torch.allclose(outputs.logits[0, :3, :3]							,      lowerCAmelCase_							,      atol=1e-4 ) )

														# verify the loss (`config.norm_pix_loss` = `True`)
														_a     					=    torch.tensor([0.5_1_4_2]							,      device=lowerCAmelCase_ )
														self.assertTrue(torch.allclose(outputs.loss							,      lowerCAmelCase_							,      atol=1e-4 ) )

														# verify the loss (`config.norm_pix_loss` = `False`)
														_a     					=    VideoMAEForPreTraining.from_pretrained('''MCG-NJU/videomae-base-short'''							,      norm_pix_loss=lowerCAmelCase_ ).to(
														    lowerCAmelCase_ )

														with torch.no_grad():
																					_a     					=    model(**lowerCAmelCase_ )

														_a     					=    torch.tensor(torch.tensor([0.6_4_6_9] )							,      device=lowerCAmelCase_ )
														self.assertTrue(torch.allclose(outputs.loss							,      lowerCAmelCase_							,      atol=1e-4 ) )

