




'''simple docstring'''





from ...configuration_utils import PretrainedConfig
from ...utils import logging


a		:	List[str]       =      logging.get_logger(__name__)

a		:	List[Any]       =      {
    '''MCG-NJU/videomae-base''': '''https://huggingface.co/MCG-NJU/videomae-base/resolve/main/config.json''',
}




class      UpperCamelCase       (	snake_case__       ):
  a     :List[str]          =					'videomae'



  def __init__(			self		,     __lowerCAmelCase=224		,     __lowerCAmelCase=16		,     __lowerCAmelCase=3		,     __lowerCAmelCase=16		,     __lowerCAmelCase=2		,     __lowerCAmelCase=768		,     __lowerCAmelCase=12		,     __lowerCAmelCase=12		,     __lowerCAmelCase=3072		,     __lowerCAmelCase="gelu"		,     __lowerCAmelCase=0.0		,     __lowerCAmelCase=0.0		,     __lowerCAmelCase=0.02		,     __lowerCAmelCase=1e-12		,     __lowerCAmelCase=True		,     __lowerCAmelCase=True		,     __lowerCAmelCase=6		,     __lowerCAmelCase=384		,     __lowerCAmelCase=4		,     __lowerCAmelCase=1536		,     __lowerCAmelCase=True		,     **__lowerCAmelCase		,     ):







      '''simple docstring'''


      super().__init__(**__lowerCAmelCase )

      _a				:							List[Any]							       =      image_size
      _a				:							Union[str, Any]							       =      patch_size
      _a				:							Any							       =      num_channels
      _a				:							Optional[int]							       =      num_frames
      _a				:							Optional[int]							       =      tubelet_size

      _a				:							Tuple							       =      hidden_size
      _a				:							Union[str, Any]							       =      num_hidden_layers
      _a				:							List[str]							       =      num_attention_heads
      _a				:							Optional[int]							       =      intermediate_size
      _a				:							Union[str, Any]							       =      hidden_act
      _a				:							Union[str, Any]							       =      hidden_dropout_prob
      _a				:							str							       =      attention_probs_dropout_prob
      _a				:							int							       =      initializer_range
      _a				:							int							       =      layer_norm_eps
      _a				:							Dict							       =      qkv_bias
      _a				:							List[str]							       =      use_mean_pooling

      _a				:							Optional[int]							       =      decoder_num_attention_heads
      _a				:							int							       =      decoder_hidden_size
      _a				:							List[Any]							       =      decoder_num_hidden_layers
      _a				:							Optional[Any]							       =      decoder_intermediate_size
      _a				:							Dict							       =      norm_pix_loss




import unittest

from transformers import is_torch_available
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device


if is_torch_available():
				import torch

				from transformers import CamembertModel
@require_torch
@require_sentencepiece
@require_tokenizers
class    _UpperCamelCase(   unittest.TestCase				):

						@slow
						def 						a__ (					self		:			Optional[Any]			):
													_UpperCAmelCase  :			Tuple	       =		CamembertModel.from_pretrained("camembert-base"			)
													model.to(_lowerCamelCase			)

													_UpperCAmelCase  :			List[Any]	       =		torch.tensor(
													    [[5, 1_21, 11, 6_60, 16, 7_30, 2_55_43, 1_10, 83, 6]]	,						device=_lowerCamelCase	,						dtype=torch.long	,						)  # J'aime le camembert !
													with torch.no_grad():
																				_UpperCAmelCase  :			Dict	       =		model(_lowerCamelCase			)["last_hidden_state"]
													_UpperCAmelCase  :			Optional[int]	       =		torch.Size((1, 10, 7_68)			)
													self.assertEqual(output.shape	,						_lowerCamelCase			)
													# compare the actual values for a slice.
													_UpperCAmelCase  :			List[str]	       =		torch.tensor(
													    [[[-0.02_54, 0.02_35, 0.10_27], [0.06_06, -0.18_11, -0.04_18], [-0.15_61, -0.11_27, 0.26_87]]]	,						device=_lowerCamelCase	,						dtype=torch.float	,						)
													# camembert = torch.hub.load('pytorch/fairseq', 'camembert.v0')
													# camembert.eval()
													# expected_slice = roberta.model.forward(input_ids)[0][:, :3, :3].detach()

													self.assertTrue(torch.allclose(output[:, :3, :3]	,						_lowerCamelCase	,						atol=1E-4			)			)




