

'''simple docstring'''


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


lowerCAmelCase__						:       Tuple											=						logging.get_logger(__name__)

lowerCAmelCase__						:       Dict											=						{
    """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			(				SCREAMING_SNAKE_CASE       ):






						"""simple docstring"""




						__UpperCAmelCase			     =    """vivit"""







						def __init__(							self					:      Optional[Any]			,			snake_case_					:      Tuple=2_2_4			,			snake_case_					:      List[str]=3_2			,			snake_case_					:      Union[str, Any]=[2, 1_6, 1_6]			,			snake_case_					:      str=3			,			snake_case_					:      Any=7_6_8			,			snake_case_					:      Union[str, Any]=1_2			,			snake_case_					:      Optional[int]=1_2			,			snake_case_					:      List[Any]=3_0_7_2			,			snake_case_					:      Dict="gelu_fast"			,			snake_case_					:      List[str]=0.0			,			snake_case_					:      List[Any]=0.0			,			snake_case_					:      Tuple=0.0_2			,			snake_case_					:      Tuple=1e-06			,			snake_case_					:      List[Any]=True			,			**snake_case_					:      Dict			,			):



								'''simple docstring'''



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

								snake_case__						:       Any       						=  image_size
								snake_case__						:       str       						=  num_frames
								snake_case__						:       str       						=  tubelet_size
								snake_case__						:       Dict       						=  num_channels
								snake_case__						:       Any       						=  qkv_bias

								super().__init__(**snake_case_  )






'''simple docstring'''


from bisect import bisect
from itertools import accumulate




def 	_a       (				__lowerCAmelCase		:      Optional[int]   ,							__lowerCAmelCase		:      Tuple   ,							__lowerCAmelCase		:      List[Any]   ,							__lowerCAmelCase		:      Optional[Any]     ):

		"""simple docstring"""

		snake_case__						:       Any       						=  sorted(zip(__lowerCAmelCase   ,							__lowerCAmelCase     )   ,							key=lambda __lowerCAmelCase     : x[0] / x[1]   ,							reverse=__lowerCAmelCase     )
		snake_case__						,       snake_case__						:       Union[str, Any]       						=  [i[0] for i in r], [i[1] for i in r]
		snake_case__						:       Dict       						=  list(accumulate(__lowerCAmelCase     )     )
		snake_case__						:       Optional[int]       						=  bisect(__lowerCAmelCase   ,							__lowerCAmelCase     )
		return (
		    0
		    if k == 0
		    else sum(vl[:k]     ) + (w - acc[k - 1]) * (vl[k]) / (wt[k])
		    if k != n
		    else sum(vl[:k]     )
		)


if __name__ == "__main__":
					import doctest

					doctest.testmod()



