


'''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    lowercase	(							A__					):

		"""simple docstring"""

		_a     =				'vivit'




		def __init__(		self    ,   UpperCamelCase_=224    ,   UpperCamelCase_=32    ,   UpperCamelCase_=[2, 16, 16]    ,   UpperCamelCase_=3    ,   UpperCamelCase_=768    ,   UpperCamelCase_=12    ,   UpperCamelCase_=12    ,   UpperCamelCase_=3072    ,   UpperCamelCase_="gelu_fast"    ,   UpperCamelCase_=0.0    ,   UpperCamelCase_=0.0    ,   UpperCamelCase_=0.02    ,   UpperCamelCase_=1e-06    ,   UpperCamelCase_=True    ,   **UpperCamelCase_    ,   ):

							'''simple docstring'''


							UpperCamelCase__   :Tuple												= hidden_size
							UpperCamelCase__   :int												= num_hidden_layers
							UpperCamelCase__   :Optional[Any]												= num_attention_heads
							UpperCamelCase__   :List[str]												= intermediate_size
							UpperCamelCase__   :Dict												= hidden_act
							UpperCamelCase__   :str												= hidden_dropout_prob
							UpperCamelCase__   :Optional[Any]												= attention_probs_dropout_prob
							UpperCamelCase__   :Optional[int]												= initializer_range
							UpperCamelCase__   :int												= layer_norm_eps

							UpperCamelCase__   :List[Any]												= image_size
							UpperCamelCase__   :Optional[Any]												= num_frames
							UpperCamelCase__   :Dict												= tubelet_size
							UpperCamelCase__   :Optional[int]												= num_channels
							UpperCamelCase__   :List[Any]												= qkv_bias

							super().__init__(**UpperCamelCase_							)


def 			A_      (    _UpperCAmelCase				,	_UpperCAmelCase				,	_UpperCAmelCase				,	_UpperCAmelCase				,	_UpperCAmelCase				,	):
						SCREAMING_SNAKE_CASE_: Optional[int]  		=       [redshift, radiation_density, matter_density, dark_energy]
						if any(p < 0 for p in parameters    ):
												raise ValueError("All input parameters must be positive"    )

						if any(p > 1 for p in parameters[1:4]    ):
												raise ValueError("Relative densities cannot be greater than one"    )
						else:
												SCREAMING_SNAKE_CASE_: int  		=       1 - (matter_density + radiation_density + dark_energy)

												SCREAMING_SNAKE_CASE_: Dict  		=       (
												    radiation_density * (redshift + 1) ** 4
												    + matter_density * (redshift + 1) ** 3
												    + curvature * (redshift + 1) ** 2
												    + dark_energy
												)

												SCREAMING_SNAKE_CASE_: Any  		=       hubble_constant * e_a ** (1 / 2)
												return hubble


if __name__ == "__main__":
						import doctest

						# run doctest
						doctest.testmod()

						# demo LCDM approximation
						lowerCAmelCase							:  List[Any]   	=						0.3

						print(
						    hubble_parameter(
						        hubble_constant=68.3,
						        radiation_density=1E-4,
						        matter_density=matter_density,
						        dark_energy=1 - matter_density,
						        redshift=0,
						    )
						)






