

'''simple docstring'''






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


__SCREAMING_SNAKE_CASE     =						logging.get_logger(__name__)

__SCREAMING_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 			lowerCAmelCase__     (					lowerCAmelCase__						):




     """simple docstring"""





     __UpperCamelCase									= """vivit"""







     def __init__(		self						:	int      ,						A__						:	Dict=2_2_4      ,						A__						:	Tuple=3_2      ,						A__						:	List[Any]=[2, 1_6, 1_6]      ,						A__						:	List[str]=3      ,						A__						:	Union[str, Any]=7_6_8      ,						A__						:	List[Any]=1_2      ,						A__						:	Optional[int]=1_2      ,						A__						:	List[str]=3_0_7_2      ,						A__						:	Tuple="gelu_fast"      ,						A__						:	Tuple=0.0      ,						A__						:	int=0.0      ,						A__						:	str=0.02      ,						A__						:	str=1E-06      ,						A__						:	Union[str, Any]=True      ,						**A__						:	Optional[int]      ,						)       ->			int:
          '''simple docstring'''




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

          a__   :      str     =						image_size
          a__   :      Any     =						num_frames
          a__   :      Any     =						tubelet_size
          a__   :      Tuple     =						num_channels
          a__   :      str     =						qkv_bias

          super().__init__(**__a	)




"""simple docstring"""


from __future__ import annotations

import math

import numpy as np
from numpy.linalg import norm


def _lowerCamelCase      (						_UpperCamelCase       ,					_UpperCamelCase ):

			'''simple docstring'''




			return math.sqrt(sum(pow(a - b       ,					2 ) for a, b in zip(_UpperCamelCase       ,					_UpperCamelCase ) ) )


def _lowerCamelCase      (						_UpperCamelCase       ,					_UpperCamelCase ):

			'''simple docstring'''




			if dataset.ndim != value_array.ndim:
						__lowerCAmelCase							       =     (
						    "Wrong input data's dimensions... "
						    f"dataset : {dataset.ndim}, value_array : {value_array.ndim}"
						)
						raise ValueError(_UpperCamelCase )

			try:
						if dataset.shape[1] != value_array.shape[1]:
									__lowerCAmelCase							       =     (
									    "Wrong input data's shape... "
									    f"dataset : {dataset.shape[1]}, value_array : {value_array.shape[1]}"
									)
									raise ValueError(_UpperCamelCase )
			except IndexError:
						if dataset.ndim != value_array.ndim:
									raise TypeError("Wrong shape" )

			if dataset.dtype != value_array.dtype:
						__lowerCAmelCase							       =     (
						    "Input data have different datatype... "
						    f"dataset : {dataset.dtype}, value_array : {value_array.dtype}"
						)
						raise TypeError(_UpperCamelCase )

			__lowerCAmelCase							       =     []

			for value in value_array:
						__lowerCAmelCase							       =     euclidean(_UpperCamelCase       ,					dataset[0] )
						__lowerCAmelCase							       =     dataset[0].tolist()

						for dataset_value in dataset[1:]:
									__lowerCAmelCase							       =     euclidean(_UpperCamelCase       ,					_UpperCamelCase )

									if dist > temp_dist:
												__lowerCAmelCase							       =     temp_dist
												__lowerCAmelCase							       =     dataset_value.tolist()

						answer.append([vector, dist] )

			return answer


def _lowerCamelCase      (						_UpperCamelCase       ,					_UpperCamelCase ):

			'''simple docstring'''




			return np.dot(_UpperCamelCase       ,					_UpperCamelCase ) / (norm(_UpperCamelCase ) * norm(_UpperCamelCase ))


if __name__ == "__main__":
	import doctest

	doctest.testmod()




