






"""simple docstring"""
from typing import List

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


lowerCamelCase_							      = logging.get_logger(__name__)

lowerCamelCase_							      = {
    '''snap-research/efficientformer-l1-300''': (
        '''https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json'''
    ),
}







class      UpperCamelCase_			(__A	):
	__magic_name__       =							'''efficientformer'''





	def __init__( self   :					int      ,      lowerCAmelCase_   :					List[int] = [3, 2, 6, 4]      ,      lowerCAmelCase_   :					List[int] = [48, 96, 224, 448]      ,      lowerCAmelCase_   :					List[bool] = [True, True, True, True]      ,      lowerCAmelCase_   :					int = 448      ,      lowerCAmelCase_   :					int = 32      ,      lowerCAmelCase_   :					int = 4      ,      lowerCAmelCase_   :					int = 7      ,      lowerCAmelCase_   :					int = 5      ,      lowerCAmelCase_   :					int = 8      ,      lowerCAmelCase_   :					int = 4      ,      lowerCAmelCase_   :					float = 0.0      ,      lowerCAmelCase_   :					int = 16      ,      lowerCAmelCase_   :					int = 3      ,      lowerCAmelCase_   :					int = 3      ,      lowerCAmelCase_   :					int = 3      ,      lowerCAmelCase_   :					int = 2      ,      lowerCAmelCase_   :					int = 1      ,      lowerCAmelCase_   :					float = 0.0      ,      lowerCAmelCase_   :					int = 1      ,      lowerCAmelCase_   :					bool = True      ,      lowerCAmelCase_   :					bool = True      ,      lowerCAmelCase_   :					float = 1e-5      ,      lowerCAmelCase_   :					str = "gelu"      ,      lowerCAmelCase_   :					float = 0.0_2      ,      lowerCAmelCase_   :					float = 1e-12      ,      lowerCAmelCase_   :					int = 224      ,      lowerCAmelCase_   :					float = 1e-05      ,      **lowerCAmelCase_   :					List[str]      ,      )		->     None:
				super().__init__(**lowerCAmelCase_		)

				UpperCAmelCase_	:					int     	=   hidden_act
				UpperCAmelCase_	:					Optional[int]     	=   hidden_dropout_prob
				UpperCAmelCase_	:					Any     	=   hidden_sizes
				UpperCAmelCase_	:					Dict     	=   num_hidden_layers
				UpperCAmelCase_	:					List[Any]     	=   num_attention_heads
				UpperCAmelCase_	:					int     	=   initializer_range
				UpperCAmelCase_	:					Any     	=   layer_norm_eps
				UpperCAmelCase_	:					Any     	=   patch_size
				UpperCAmelCase_	:					Optional[int]     	=   num_channels
				UpperCAmelCase_	:					Any     	=   depths
				UpperCAmelCase_	:					Optional[Any]     	=   mlp_expansion_ratio
				UpperCAmelCase_	:					Tuple     	=   downsamples
				UpperCAmelCase_	:					List[Any]     	=   dim
				UpperCAmelCase_	:					Tuple     	=   key_dim
				UpperCAmelCase_	:					Tuple     	=   attention_ratio
				UpperCAmelCase_	:					Any     	=   resolution
				UpperCAmelCase_	:					Any     	=   pool_size
				UpperCAmelCase_	:					str     	=   downsample_patch_size
				UpperCAmelCase_	:					Optional[Any]     	=   downsample_stride
				UpperCAmelCase_	:					Tuple     	=   downsample_pad
				UpperCAmelCase_	:					Optional[Any]     	=   drop_path_rate
				UpperCAmelCase_	:					List[str]     	=   num_metaad_blocks
				UpperCAmelCase_	:					Optional[Any]     	=   distillation
				UpperCAmelCase_	:					Optional[Any]     	=   use_layer_scale
				UpperCAmelCase_	:					Dict     	=   layer_scale_init_value
				UpperCAmelCase_	:					Any     	=   image_size
				UpperCAmelCase_	:					Optional[Any]     	=   batch_norm_eps











from __future__ import annotations

def   __lowercase       (			snake_case,	snake_case			):







				"""simple docstring"""






				print(f'''Vertex\tShortest Distance from vertex {src}'''			)
				for i, d in enumerate(snake_case			):
								print(f'''{i}\t\t{d}'''			)

def   __lowercase       (			snake_case,	snake_case,	snake_case			):







				"""simple docstring"""






				for j in range(snake_case			):
								__magic_name__  ,					__magic_name__  ,					__magic_name__		:Tuple   =   (graph[j][k] for k in ['''src''', '''dst''', '''weight'''])
								if distance[u] != float('''inf'''			) and distance[u] + w < distance[v]:
												return True
				return False

def   __lowercase       (			snake_case,	snake_case,	snake_case,	snake_case			):







				"""simple docstring"""






				__magic_name__		:List[Any]   =   [float('''inf'''			)] * vertex_count
				__magic_name__		:Tuple   =   0.0

				for _ in range(vertex_count - 1			):
								for j in range(snake_case			):
												__magic_name__  ,					__magic_name__  ,					__magic_name__		:Dict   =   (graph[j][k] for k in ['''src''', '''dst''', '''weight'''])

												if distance[u] != float('''inf'''			) and distance[u] + w < distance[v]:
																__magic_name__		:Tuple   =   distance[u] + w

				__magic_name__		:Tuple   =   check_negative_cycle(snake_case,	snake_case,	snake_case			)
				if negative_cycle_exists:
								raise Exception('''Negative cycle found'''			)

				return distance


if __name__ == "__main__":
					import doctest

					doctest.testmod()

					SCREAMING_SNAKE_CASE__   :      Tuple				=		int(input("""Enter number of vertices: """).strip())
					SCREAMING_SNAKE_CASE__   :      Any				=		int(input("""Enter number of edges: """).strip())

					SCREAMING_SNAKE_CASE__   :      list[dict[str, int]]				=		[{} for _ in range(E)]

					for i in range(E):
										print("""Edge """, i + 1)
										SCREAMING_SNAKE_CASE__				,       SCREAMING_SNAKE_CASE__				,       SCREAMING_SNAKE_CASE__   :      Dict				=		(
										    int(x)
										    for x in input("""Enter source, destination, weight: """).strip().split(""" """)
										)
										SCREAMING_SNAKE_CASE__   :      Dict				=		{"""src""": src, """dst""": dest, """weight""": weight}

					SCREAMING_SNAKE_CASE__   :      List[Any]				=		int(input("""\nEnter shortest path source:""").strip())
					SCREAMING_SNAKE_CASE__   :      List[str]				=		bellman_ford(graph, V, E, source)
					print_distance(shortest_distance, 0)






