



'''simple docstring'''


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


_lowerCamelCase	:       Tuple      	=	logging.get_logger(__name__)

_lowerCamelCase	:       List[str]      	=	{
    "tanreinama/GPTSAN-2.8B-spout_is_uniform": (
        "https://huggingface.co/tanreinama/GPTSAN-2.8B-spout_is_uniform/resolve/main/config.json"
    ),
}

class  SCREAMING_SNAKE_CASE (  _a		):






    """simple docstring"""





    _SCREAMING_SNAKE_CASE	  =  """gptsan-japanese"""
    _SCREAMING_SNAKE_CASE	  =  [
        """past_key_values""",
    ]
    _SCREAMING_SNAKE_CASE	  =  {
        """hidden_size""": """d_model""",
        """num_attention_heads""": """num_heads""",
        """num_hidden_layers""": """num_layers""",
    }






    def __init__(  self      :					int  ,						UpperCamelCase__      :					Tuple=3_6_0_0_0  ,						UpperCamelCase__      :					int=1_2_8_0  ,						UpperCamelCase__      :					str=1_0_2_4  ,						UpperCamelCase__      :					Dict=8_1_9_2  ,						UpperCamelCase__      :					int=4_0_9_6  ,						UpperCamelCase__      :					List[Any]=1_2_8  ,						UpperCamelCase__      :					List[str]=1_0  ,						UpperCamelCase__      :					Union[str, Any]=0  ,						UpperCamelCase__      :					List[str]=1_6  ,						UpperCamelCase__      :					Union[str, Any]=1_6  ,						UpperCamelCase__      :					Tuple=1_2_8  ,						UpperCamelCase__      :					Tuple=0.0  ,						UpperCamelCase__      :					Optional[int]=1E-5  ,						UpperCamelCase__      :					Any=False  ,						UpperCamelCase__      :					Tuple=0.0  ,						UpperCamelCase__      :					Optional[Any]="float32"  ,						UpperCamelCase__      :					Optional[int]=False  ,						UpperCamelCase__      :					Union[str, Any]=False  ,						UpperCamelCase__      :					Optional[Any]=False  ,						UpperCamelCase__      :					List[Any]=0.0_0_2  ,						UpperCamelCase__      :					Optional[Any]=False  ,						UpperCamelCase__      :					List[str]=True  ,						UpperCamelCase__      :					Tuple=3_5_9_9_8  ,						UpperCamelCase__      :					Union[str, Any]=3_5_9_9_5  ,						UpperCamelCase__      :					int=3_5_9_9_9  ,						**UpperCamelCase__      :					int  ,						):


       """simple docstring"""







       UpperCamelCase					=  vocab_size
       UpperCamelCase					=  max_position_embeddings
       UpperCamelCase					=  d_model
       UpperCamelCase					=  d_ff
       UpperCamelCase					=  d_ext
       UpperCamelCase					=  d_spout
       UpperCamelCase					=  num_switch_layers
       UpperCamelCase					=  num_ext_layers
       UpperCamelCase					=  num_switch_layers + num_ext_layers
       UpperCamelCase					=  num_heads
       UpperCamelCase					=  num_experts
       UpperCamelCase					=  expert_capacity
       UpperCamelCase					=  dropout_rate
       UpperCamelCase					=  layer_norm_epsilon
       UpperCamelCase					=  router_bias
       UpperCamelCase					=  router_jitter_noise
       UpperCamelCase					=  router_dtype
       UpperCamelCase					=  router_ignore_padding_tokens
       UpperCamelCase					=  output_hidden_states
       UpperCamelCase					=  output_attentions
       UpperCamelCase					=  initializer_factor
       UpperCamelCase					=  output_router_logits
       UpperCamelCase					=  use_cache

       super().__init__(
           separator_token_id=UpperCamelCase__  ,						pad_token_id=UpperCamelCase__  ,						eos_token_id=UpperCamelCase__  ,						**UpperCamelCase__  ,						)






'''simple docstring'''


import math

class  SCREAMING_SNAKE_CASE :






    """simple docstring"""





    def __init__(  self      :					Union[str, Any]  ,						UpperCamelCase__      :					Optional[Any]=0 ):  # a graph with Node 0,1,...,N-1


       """simple docstring"""







       UpperCamelCase					=  n
       UpperCamelCase					=  [
           [math.inf for j in range(0  ,						UpperCamelCase__ )] for i in range(0  ,						UpperCamelCase__ )
       ]  # adjacency matrix for weight
       UpperCamelCase					=  [
           [math.inf for j in range(0  ,						UpperCamelCase__ )] for i in range(0  ,						UpperCamelCase__ )
       ]  # dp[i][j] stores minimum distance from i to j






    def  A       (  self      :					Optional[Any]  ,						UpperCamelCase__      :					Union[str, Any]  ,						UpperCamelCase__      :					Union[str, Any]  ,						UpperCamelCase__      :					Tuple ):


       """simple docstring"""







       UpperCamelCase					=  w






    def  A       (  self      :					str ):


       """simple docstring"""







       for k in range(0  ,						self.n ):
          for i in range(0  ,						self.n ):
             for j in range(0  ,						self.n ):
                UpperCamelCase					=  min(self.dp[i][j]  ,						self.dp[i][k] + self.dp[k][j] )






    def  A       (  self      :					Optional[Any]  ,						UpperCamelCase__      :					str  ,						UpperCamelCase__      :					List[Any] ):


       """simple docstring"""







       return self.dp[u][v]


if __name__ == "__main__":
   _lowerCamelCase	:       List[str]      	=	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)

