


'''simple docstring'''

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


__lowercase:						int  		=   logging.get_logger(__name__)

__lowercase:						Tuple  		=   {
    "MCG-NJU/videomae-base": "https://huggingface.co/MCG-NJU/videomae-base/resolve/main/config.json",
}







class        UpperCAmelCase       (				__SCREAMING_SNAKE_CASE):
 _lowerCamelCase       :    List[Any]			    =    "videomae"

 def __init__(       self       :		Dict,    a_       :		List[str]=224,    a_       :		Dict=16,    a_       :		Dict=3,    a_       :		Optional[int]=16,    a_       :		int=2,    a_       :		Any=768,    a_       :		int=12,    a_       :		Optional[int]=12,    a_       :		Optional[int]=3072,    a_       :		str="gelu",    a_       :		Optional[Any]=0.0,    a_       :		List[Any]=0.0,    a_       :		List[Any]=0.02,    a_       :		Tuple=1e-1_2,    a_       :		List[str]=True,    a_       :		Any=True,    a_       :		Optional[int]=6,    a_       :		Union[str, Any]=384,    a_       :		Union[str, Any]=4,    a_       :		Optional[Any]=1536,    a_       :		Optional[Any]=True,    **a_       :		Any,    ):





    """simple docstring"""



    super().__init__(**a_    )

    UpperCamelCase__         =  image_size
    UpperCamelCase__         =  patch_size
    UpperCamelCase__         =  num_channels
    UpperCamelCase__         =  num_frames
    UpperCamelCase__         =  tubelet_size

    UpperCamelCase__         =  hidden_size
    UpperCamelCase__         =  num_hidden_layers
    UpperCamelCase__         =  num_attention_heads
    UpperCamelCase__         =  intermediate_size
    UpperCamelCase__         =  hidden_act
    UpperCamelCase__         =  hidden_dropout_prob
    UpperCamelCase__         =  attention_probs_dropout_prob
    UpperCamelCase__         =  initializer_range
    UpperCamelCase__         =  layer_norm_eps
    UpperCamelCase__         =  qkv_bias
    UpperCamelCase__         =  use_mean_pooling

    UpperCamelCase__         =  decoder_num_attention_heads
    UpperCamelCase__         =  decoder_hidden_size
    UpperCamelCase__         =  decoder_num_hidden_layers
    UpperCamelCase__         =  decoder_intermediate_size
    UpperCamelCase__         =  norm_pix_loss





import unittest

import numpy as np

from transformers import is_tf_available
from transformers.testing_utils import require_tf


if is_tf_available():
				import tensorflow as tf

				from transformers.activations_tf import get_tf_activation





@require_tf
class 		A__				(   unittest.TestCase ):






	def  lowercase      (	self						)      ->   Dict:




						"""simple docstring"""






						__magic_name__					:							int		   =							tf.constant([-100, -1.0, -0.1, 0, 0.1, 1.0, 1_0_0.0]						)
						__magic_name__					:							List[str]		   =							get_tf_activation('''gelu'''						)
						__magic_name__					:							str		   =							get_tf_activation('''gelu_10'''						)

						__magic_name__					:							List[str]		   =							gelu(lowerCamelCase						)
						__magic_name__					:							Optional[Any]		   =							geluaa(lowerCamelCase						)

						__magic_name__					:							Optional[int]		   =							tf.where(y_gelu_aa < 1_0.0				,     1.0				,     0.0						)

						self.assertEqual(tf.math.reduce_max(lowerCamelCase						).numpy().item()				,     1_0.0						)
						self.assertTrue(np.allclose(y_gelu * clipped_mask				,     y_gelu_aa * clipped_mask						)						)






	def  lowercase      (	self						)      ->   Dict:




						"""simple docstring"""






						get_tf_activation('''gelu'''						)
						get_tf_activation('''gelu_10'''						)
						get_tf_activation('''gelu_fast'''						)
						get_tf_activation('''gelu_new'''						)
						get_tf_activation('''glu'''						)
						get_tf_activation('''mish'''						)
						get_tf_activation('''quick_gelu'''						)
						get_tf_activation('''relu'''						)
						get_tf_activation('''sigmoid'''						)
						get_tf_activation('''silu'''						)
						get_tf_activation('''swish'''						)
						get_tf_activation('''tanh'''						)
						with self.assertRaises(lowerCamelCase						):
											get_tf_activation('''bogus'''						)
						with self.assertRaises(lowerCamelCase						):
											get_tf_activation(lowerCamelCase						)



