
from __future__ import annotations

from typing import Dict

from ...configuration_utils import PretrainedConfig


_A     =  {
    "susnato/ernie-m-base_pytorch": "https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/config.json",
    "susnato/ernie-m-large_pytorch": "https://huggingface.co/susnato/ernie-m-large_pytorch/blob/main/config.json",
}





class 			_lowerCAmelCase      (			__a ):
				_lowercase    	='''ernie_m'''
				_lowercase    	={"dropout": "classifier_dropout", "num_classes": "num_labels"}




				def __init__(      self       ,       _UpperCamelCase = 250_002       ,       _UpperCamelCase = 768       ,       _UpperCamelCase = 12       ,       _UpperCamelCase = 12       ,       _UpperCamelCase = 3_072       ,       _UpperCamelCase = "gelu"       ,       _UpperCamelCase = 0.1       ,       _UpperCamelCase = 0.1       ,       _UpperCamelCase = 514       ,       _UpperCamelCase = 0.02       ,       _UpperCamelCase = 1       ,       _UpperCamelCase = 1e-0_5       ,       _UpperCamelCase=None       ,       _UpperCamelCase=False       ,       _UpperCamelCase=0.0       ,       **_UpperCamelCase       ,       )       ->   Union[str, Any]:
							super().__init__(pad_token_id=_UpperCamelCase       ,       **_UpperCamelCase  )
							lowerCAmelCase_      			=			vocab_size
							lowerCAmelCase_      			=			hidden_size
							lowerCAmelCase_      			=			num_hidden_layers
							lowerCAmelCase_      			=			num_attention_heads
							lowerCAmelCase_      			=			intermediate_size
							lowerCAmelCase_      			=			hidden_act
							lowerCAmelCase_      			=			hidden_dropout_prob
							lowerCAmelCase_      			=			attention_probs_dropout_prob
							lowerCAmelCase_      			=			max_position_embeddings
							lowerCAmelCase_      			=			initializer_range
							lowerCAmelCase_      			=			layer_norm_eps
							lowerCAmelCase_      			=			classifier_dropout
							lowerCAmelCase_      			=			is_decoder
							lowerCAmelCase_      			=			act_dropout





import math





class 			_lowerCAmelCase      :




				def __init__(      self       ,       _UpperCamelCase=0  )       ->   Tuple:  # a graph with Node 0,1,...,N-1
							lowerCAmelCase_      			=			n
							lowerCAmelCase_      			=			[
							    [math.inf for j in range(0       ,       _UpperCamelCase  )] for i in range(0       ,       _UpperCamelCase  )
							]  # adjacency matrix for weight
							lowerCAmelCase_      			=			[
							    [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       ,       _UpperCamelCase       ,       _UpperCamelCase       ,       _UpperCamelCase  )       ->   List[Any]:
							lowerCAmelCase_      			=			w




				def   __a		(      self  )       ->   List[str]:
							for k in range(0       ,       self.n  ):
										for i in range(0       ,       self.n  ):
													for j in range(0       ,       self.n  ):
																lowerCAmelCase_      			=			min(self.dp[i][j]       ,       self.dp[i][k] + self.dp[k][j]  )




				def   __a		(      self       ,       _UpperCamelCase       ,       _UpperCamelCase  )       ->   Dict:
							return self.dp[u][v]


if __name__ == "__main__":
			_A     =  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)



