



"""simple docstring"""


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


snake_case_    					=	logging.get_logger(__name__)

snake_case_    					=	{
    """google/vivit-b-16x2-kinetics400""": (
        """https://huggingface.co/google/vivit-b-16x2-kinetics400/resolve/main/config.json"""
    ),
    # See all Vivit models at https://huggingface.co/models?filter=vivit
}







class 				A_      (					lowercase__    ):



      """simple docstring"""
      __UpperCamelCase		    =							'''vivit'''






      def __init__( self			:Tuple       ,  lowercase_			:int=2_24       ,  lowercase_			:Optional[Any]=32       ,  lowercase_			:Optional[Any]=[2, 16, 16]       ,  lowercase_			:Any=3       ,  lowercase_			:Union[str, Any]=7_68       ,  lowercase_			:Optional[Any]=12       ,  lowercase_			:Optional[int]=12       ,  lowercase_			:Dict=30_72       ,  lowercase_			:List[Any]="gelu_fast"       ,  lowercase_			:List[Any]=0.0       ,  lowercase_			:Optional[int]=0.0       ,  lowercase_			:List[str]=0.02       ,  lowercase_			:List[Any]=1E-06       ,  lowercase_			:List[str]=True       ,  **lowercase_			:Tuple       ,  )    ->      str:
            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					=			image_size
            UpperCAmelCase					=			num_frames
            UpperCAmelCase					=			tubelet_size
            UpperCAmelCase					=			num_channels
            UpperCAmelCase					=			qkv_bias

            super().__init__(**_a )










"""simple docstring"""


import math

def 			_lowerCAmelCase				(       lowercase_						):
						assert isinstance(lowercase_		,     lowercase_						) and (
						    number >= 0
						), "'number' must been an int and positive"

						if 1 < number < 4:
												# 2 and 3 are primes
												return True
						elif number < 2 or not number % 2:
												# Negatives, 0, 1 and all even numbers are not primes
												return False

						UpperCAmelCase					=			range(3		,     int(math.sqrt(lowercase_						) + 1						)		,     2						)
						return not any(not number % i for i in odd_numbers						)






def 			_lowerCAmelCase				(       lowercase_		,     lowercase_=1		,     **lowercase_						):
						UpperCAmelCase					=			factor * value
						UpperCAmelCase					=			value

						while not is_prime(lowercase_						):
												value += 1 if not ("desc" in kwargs and kwargs["desc"] is True) else -1

						if value == first_value_val:
												return next_prime(value + 1		,     **lowercase_						)
						return value





