




"""simple docstring"""






import math






class lowerCAmelCase__	:






			'''simple docstring'''



			def __init__(  self  ,      lowercase=0  ):  # a graph with Node 0,1,...,N-1
							_lowerCamelCase     :			List[str]    =    n
							_lowerCamelCase     :			str    =    [
							    [math.inf for j in range(0  ,      lowercase  )] for i in range(0  ,      lowercase  )
							]  # adjacency matrix for weight
							_lowerCamelCase     :			List[str]    =    [
							    [math.inf for j in range(0  ,      lowercase  )] for i in range(0  ,      lowercase  )
							]  # dp[i][j] stores minimum distance from i to j
			def 					A_    (  self  ,      lowercase  ,      lowercase  ,      lowercase  ):
							_lowerCamelCase     :			Union[str, Any]    =    w
			def 					A_    (  self  ):
							for k in range(0  ,      self.n  ):
											for i in range(0  ,      self.n  ):
															for j in range(0  ,      self.n  ):
																			_lowerCamelCase     :			Dict    =    min(self.dp[i][j]  ,      self.dp[i][k] + self.dp[k][j]  )






			def 					A_    (  self  ,      lowercase  ,      lowercase  ):
							return self.dp[u][v]


if __name__ == "__main__":
			lowercase__     						=						Graph(5)
			graph.add_edge(0, 2, 9)
			graph.add_edge(0, 4, 10)
			graph.add_edge(1, 3, 5)
			graph.add_edge(2, 3, 7)
			graph.add_edge(3, 0, 10)
			graph.add_edge(3, 1, 2)
			graph.add_edge(3, 2, 1)
			graph.add_edge(3, 4, 6)
			graph.add_edge(4, 1, 3)
			graph.add_edge(4, 2, 4)
			graph.add_edge(4, 3, 9)
			graph.floyd_warshall()
			graph.show_min(1, 4)
			graph.show_min(0, 3)





"""simple docstring"""






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


lowercase__     						=						logging.get_logger(__name__)

lowercase__     						=						{"""ctrl""": """https://huggingface.co/ctrl/resolve/main/config.json"""}






class lowerCAmelCase__	(     lowercase						):






			'''simple docstring'''



			lowerCamelCase__      =			"""ctrl"""
			lowerCamelCase__      =			["""past_key_values"""]
			lowerCamelCase__      =			{
			    """max_position_embeddings""": """n_positions""",
			    """hidden_size""": """n_embd""",
			    """num_attention_heads""": """n_head""",
			    """num_hidden_layers""": """n_layer""",
			}
			def __init__(  self  ,      lowercase=246534  ,      lowercase=256  ,      lowercase=1280  ,      lowercase=8192  ,      lowercase=48  ,      lowercase=16  ,      lowercase=0.1  ,      lowercase=0.1  ,      lowercase=1E-6  ,      lowercase=0.02  ,      lowercase=True  ,      **lowercase  ,      ):
							_lowerCamelCase     :			Any    =    vocab_size
							_lowerCamelCase     :			Dict    =    n_positions
							_lowerCamelCase     :			Optional[int]    =    n_embd
							_lowerCamelCase     :			str    =    n_layer
							_lowerCamelCase     :			Union[str, Any]    =    n_head
							_lowerCamelCase     :			Any    =    dff
							_lowerCamelCase     :			int    =    resid_pdrop
							_lowerCamelCase     :			Dict    =    embd_pdrop
							_lowerCamelCase     :			Union[str, Any]    =    layer_norm_epsilon
							_lowerCamelCase     :			Tuple    =    initializer_range

							_lowerCamelCase     :			str    =    use_cache

							super().__init__(**lowercase  )