





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


_lowerCamelCase :    List[Any]  							= logging.get_logger(__name__)

_lowerCamelCase :    Any  							= {
    '''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     :					List[str],			_UpperCAmelCase     :					Optional[int]=2_2_4,			_UpperCAmelCase     :					Any=3_2,			_UpperCAmelCase     :					Dict=[2, 1_6, 1_6],			_UpperCAmelCase     :					int=3,			_UpperCAmelCase     :					List[Any]=7_6_8,			_UpperCAmelCase     :					int=1_2,			_UpperCAmelCase     :					Tuple=1_2,			_UpperCAmelCase     :					Any=3_0_7_2,			_UpperCAmelCase     :					Tuple="gelu_fast",			_UpperCAmelCase     :					Dict=0.0,			_UpperCAmelCase     :					List[str]=0.0,			_UpperCAmelCase     :					Tuple=0.02,			_UpperCAmelCase     :					List[Any]=1E-06,			_UpperCAmelCase     :					Dict=True,			**_UpperCAmelCase     :					Optional[Any],			)				->			Dict:





														"""simple docstring"""
														SCREAMING_SNAKE_CASE__       :      Tuple     =						hidden_size
														SCREAMING_SNAKE_CASE__       :      Optional[Any]     =						num_hidden_layers
														SCREAMING_SNAKE_CASE__       :      Dict     =						num_attention_heads
														SCREAMING_SNAKE_CASE__       :      Any     =						intermediate_size
														SCREAMING_SNAKE_CASE__       :      Dict     =						hidden_act
														SCREAMING_SNAKE_CASE__       :      Dict     =						hidden_dropout_prob
														SCREAMING_SNAKE_CASE__       :      Union[str, Any]     =						attention_probs_dropout_prob
														SCREAMING_SNAKE_CASE__       :      List[str]     =						initializer_range
														SCREAMING_SNAKE_CASE__       :      Tuple     =						layer_norm_eps

														SCREAMING_SNAKE_CASE__       :      Optional[int]     =						image_size
														SCREAMING_SNAKE_CASE__       :      str     =						num_frames
														SCREAMING_SNAKE_CASE__       :      Union[str, Any]     =						tubelet_size
														SCREAMING_SNAKE_CASE__       :      str     =						num_channels
														SCREAMING_SNAKE_CASE__       :      int     =						qkv_bias

														super().__init__(**_UpperCAmelCase						)













from queue import PriorityQueue
from typing import Any

import numpy as np




def _a (  SCREAMING_SNAKE_CASE__      :  dict			,				SCREAMING_SNAKE_CASE__      :  str			,				SCREAMING_SNAKE_CASE__      :  set			,				SCREAMING_SNAKE_CASE__      :  set			,				SCREAMING_SNAKE_CASE__      :  dict			,				SCREAMING_SNAKE_CASE__      :  dict			,				SCREAMING_SNAKE_CASE__      :  PriorityQueue			,				SCREAMING_SNAKE_CASE__      :  dict			,				SCREAMING_SNAKE_CASE__      :  float | int			,				)	->    float | int:

							'''simple docstring'''






							for nxt, d in graph[v]:
														if nxt in visited_forward:
																					continue
														SCREAMING_SNAKE_CASE__       :      Union[str, Any]     =						cst_fwd.get(SCREAMING_SNAKE_CASE__			,				np.inf       )
														SCREAMING_SNAKE_CASE__       :      Optional[int]     =						cst_fwd[v] + d
														if new_cost_f < old_cost_f:
																					queue.put((new_cost_f, nxt)       )
																					SCREAMING_SNAKE_CASE__       :      List[Any]     =						new_cost_f
																					SCREAMING_SNAKE_CASE__       :      Union[str, Any]     =						v
														if nxt in visited_backward:
																					if cst_fwd[v] + d + cst_bwd[nxt] < shortest_distance:
																												SCREAMING_SNAKE_CASE__       :      Optional[int]     =						cst_fwd[v] + d + cst_bwd[nxt]
							return shortest_distance




def _a (  SCREAMING_SNAKE_CASE__      :  str			,				SCREAMING_SNAKE_CASE__      :  str			,				SCREAMING_SNAKE_CASE__      :  dict			,				SCREAMING_SNAKE_CASE__      :  dict       )	->    int:

							'''simple docstring'''






							SCREAMING_SNAKE_CASE__       :      Union[str, Any]     =						-1

							SCREAMING_SNAKE_CASE__       :      List[str]     =						set()
							SCREAMING_SNAKE_CASE__       :      List[Any]     =						set()
							SCREAMING_SNAKE_CASE__       :      int     =						{source: 0}
							SCREAMING_SNAKE_CASE__       :      Union[str, Any]     =						{destination: 0}
							SCREAMING_SNAKE_CASE__       :      List[Any]     =						{source: None}
							SCREAMING_SNAKE_CASE__       :      Union[str, Any]     =						{destination: None}
							SCREAMING_SNAKE_CASE__       :      PriorityQueue[Any]     =						PriorityQueue()
							SCREAMING_SNAKE_CASE__       :      PriorityQueue[Any]     =						PriorityQueue()

							SCREAMING_SNAKE_CASE__       :      Dict     =						np.inf

							queue_forward.put((0, source)       )
							queue_backward.put((0, destination)       )

							if source == destination:
														return 0

							while not queue_forward.empty() and not queue_backward.empty():
														SCREAMING_SNAKE_CASE__   ,SCREAMING_SNAKE_CASE__       :      List[str]     =						queue_forward.get()
														visited_forward.add(SCREAMING_SNAKE_CASE__       )

														SCREAMING_SNAKE_CASE__   ,SCREAMING_SNAKE_CASE__       :      List[Any]     =						queue_backward.get()
														visited_backward.add(SCREAMING_SNAKE_CASE__       )

														SCREAMING_SNAKE_CASE__       :      Any     =						pass_and_relaxation(
														    SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				)

														SCREAMING_SNAKE_CASE__       :      List[Any]     =						pass_and_relaxation(
														    SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				)

														if cst_fwd[v_fwd] + cst_bwd[v_bwd] >= shortest_distance:
																					break

							if shortest_distance != np.inf:
														SCREAMING_SNAKE_CASE__       :      int     =						shortest_distance
							return shortest_path_distance


_lowerCamelCase :    Optional[Any]  							= {
    '''B''': [['''C''', 1]],
    '''C''': [['''D''', 1]],
    '''D''': [['''F''', 1]],
    '''E''': [['''B''', 1], ['''G''', 2]],
    '''F''': [],
    '''G''': [['''F''', 1]],
}
_lowerCamelCase :    Tuple  							= {
    '''B''': [['''E''', 1]],
    '''C''': [['''B''', 1]],
    '''D''': [['''C''', 1]],
    '''F''': [['''D''', 1], ['''G''', 1]],
    '''E''': [[None, np.inf]],
    '''G''': [['''E''', 2]],
}

if __name__ == "__main__":
		import doctest

		doctest.testmod()






