


from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


lowerCamelCase :    Optional[int]						=		logging.get_logger(__name__)

lowerCamelCase :    Any						=		{
    '''xlm-mlm-en-2048''': '''https://huggingface.co/xlm-mlm-en-2048/resolve/main/config.json''',
    '''xlm-mlm-ende-1024''': '''https://huggingface.co/xlm-mlm-ende-1024/resolve/main/config.json''',
    '''xlm-mlm-enfr-1024''': '''https://huggingface.co/xlm-mlm-enfr-1024/resolve/main/config.json''',
    '''xlm-mlm-enro-1024''': '''https://huggingface.co/xlm-mlm-enro-1024/resolve/main/config.json''',
    '''xlm-mlm-tlm-xnli15-1024''': '''https://huggingface.co/xlm-mlm-tlm-xnli15-1024/resolve/main/config.json''',
    '''xlm-mlm-xnli15-1024''': '''https://huggingface.co/xlm-mlm-xnli15-1024/resolve/main/config.json''',
    '''xlm-clm-enfr-1024''': '''https://huggingface.co/xlm-clm-enfr-1024/resolve/main/config.json''',
    '''xlm-clm-ende-1024''': '''https://huggingface.co/xlm-clm-ende-1024/resolve/main/config.json''',
    '''xlm-mlm-17-1280''': '''https://huggingface.co/xlm-mlm-17-1280/resolve/main/config.json''',
    '''xlm-mlm-100-1280''': '''https://huggingface.co/xlm-mlm-100-1280/resolve/main/config.json''',
}





class  _a							(    _UpperCAmelCase):
	_a  :  int				   =							"xlm"
	_a  :  List[Any]				   =							{
	    "hidden_size": "emb_dim",
	    "num_attention_heads": "n_heads",
	    "num_hidden_layers": "n_layers",
	    "n_words": "vocab_size",  # For backward compatibility
	}




	def __init__( self						:		Union[str, Any]		, _SCREAMING_SNAKE_CASE						:		Dict=3_0145		, _SCREAMING_SNAKE_CASE						:		int=2048		, _SCREAMING_SNAKE_CASE						:		Any=12		, _SCREAMING_SNAKE_CASE						:		Tuple=16		, _SCREAMING_SNAKE_CASE						:		str=0.1		, _SCREAMING_SNAKE_CASE						:		Optional[int]=0.1		, _SCREAMING_SNAKE_CASE						:		int=True		, _SCREAMING_SNAKE_CASE						:		Optional[int]=False		, _SCREAMING_SNAKE_CASE						:		str=False		, _SCREAMING_SNAKE_CASE						:		Union[str, Any]=False		, _SCREAMING_SNAKE_CASE						:		Tuple=1		, _SCREAMING_SNAKE_CASE						:		List[Any]=True		, _SCREAMING_SNAKE_CASE						:		Dict=512		, _SCREAMING_SNAKE_CASE						:		Union[str, Any]=2048**-0.5		, _SCREAMING_SNAKE_CASE						:		int=1E-12		, _SCREAMING_SNAKE_CASE						:		Union[str, Any]=0.02		, _SCREAMING_SNAKE_CASE						:		Any=0		, _SCREAMING_SNAKE_CASE						:		int=1		, _SCREAMING_SNAKE_CASE						:		Dict=2		, _SCREAMING_SNAKE_CASE						:		Optional[int]=3		, _SCREAMING_SNAKE_CASE						:		int=5		, _SCREAMING_SNAKE_CASE						:		str=True		, _SCREAMING_SNAKE_CASE						:		List[Any]="first"		, _SCREAMING_SNAKE_CASE						:		Tuple=True		, _SCREAMING_SNAKE_CASE						:		Tuple=None		, _SCREAMING_SNAKE_CASE						:		Any=True		, _SCREAMING_SNAKE_CASE						:		str=0.1		, _SCREAMING_SNAKE_CASE						:		Any=5		, _SCREAMING_SNAKE_CASE						:		List[Any]=5		, _SCREAMING_SNAKE_CASE						:		Tuple=0		, _SCREAMING_SNAKE_CASE						:		Dict=0		, _SCREAMING_SNAKE_CASE						:		Dict=2		, _SCREAMING_SNAKE_CASE						:		int=0		, **_SCREAMING_SNAKE_CASE						:		str		, )->	int:
			lowerCAmelCase__       :      Optional[Any]   					= vocab_size
			lowerCAmelCase__       :      Any   					= emb_dim
			lowerCAmelCase__       :      Optional[int]   					= n_layers
			lowerCAmelCase__       :      Optional[int]   					= n_heads
			lowerCAmelCase__       :      Dict   					= dropout
			lowerCAmelCase__       :      str   					= attention_dropout
			lowerCAmelCase__       :      Union[str, Any]   					= gelu_activation
			lowerCAmelCase__       :      Union[str, Any]   					= sinusoidal_embeddings
			lowerCAmelCase__       :      Union[str, Any]   					= causal
			lowerCAmelCase__       :      int   					= asm
			lowerCAmelCase__       :      Tuple   					= n_langs
			lowerCAmelCase__       :      Tuple   					= use_lang_emb
			lowerCAmelCase__       :      Union[str, Any]   					= layer_norm_eps
			lowerCAmelCase__       :      List[str]   					= bos_index
			lowerCAmelCase__       :      Optional[Any]   					= eos_index
			lowerCAmelCase__       :      int   					= pad_index
			lowerCAmelCase__       :      Union[str, Any]   					= unk_index
			lowerCAmelCase__       :      Union[str, Any]   					= mask_index
			lowerCAmelCase__       :      Tuple   					= is_encoder
			lowerCAmelCase__       :      Dict   					= max_position_embeddings
			lowerCAmelCase__       :      Optional[int]   					= embed_init_std
			lowerCAmelCase__       :      Tuple   					= init_std
			lowerCAmelCase__       :      List[Any]   					= summary_type
			lowerCAmelCase__       :      List[str]   					= summary_use_proj
			lowerCAmelCase__       :      Optional[int]   					= summary_activation
			lowerCAmelCase__       :      Any   					= summary_proj_to_labels
			lowerCAmelCase__       :      Any   					= summary_first_dropout
			lowerCAmelCase__       :      List[str]   					= start_n_top
			lowerCAmelCase__       :      Any   					= end_n_top
			lowerCAmelCase__       :      Optional[Any]   					= mask_token_id
			lowerCAmelCase__       :      Union[str, Any]   					= lang_id

			if "n_words" in kwargs:
					lowerCAmelCase__       :      Tuple   					= kwargs['''n_words''']

			super().__init__(pad_token_id=_UpperCAmelCase		, bos_token_id=_UpperCAmelCase		, **_UpperCAmelCase		)





class  _a							(    _UpperCAmelCase):




	@property
	def 							UpperCAmelCase__( self						:		Optional[Any]		)->	List[str]:
			if self.task == "multiple-choice":
					lowerCAmelCase__       :      int   					= {0: '''batch''', 1: '''choice''', 2: '''sequence'''}
			else:
					lowerCAmelCase__       :      int   					= {0: '''batch''', 1: '''sequence'''}
			return OrderedDict(
			    [
			        ('''input_ids''', dynamic_axis),
			        ('''attention_mask''', dynamic_axis),
			        ('''token_type_ids''', dynamic_axis),
			    ]		)








import math





class  _a							:




	def __init__( self						:		List[Any]		, _SCREAMING_SNAKE_CASE						:		Any=0		)->	Optional[Any]:  # a graph with Node 0,1,...,N-1
			lowerCAmelCase__       :      Optional[int]   					= n
			lowerCAmelCase__       :      List[Any]   					= [
			    [math.inf for j in range(0		, _SCREAMING_SNAKE_CASE		)] for i in range(0		, _SCREAMING_SNAKE_CASE		)
			]  # adjacency matrix for weight
			lowerCAmelCase__       :      str   					= [
			    [math.inf for j in range(0		, _SCREAMING_SNAKE_CASE		)] for i in range(0		, _SCREAMING_SNAKE_CASE		)
			]  # dp[i][j] stores minimum distance from i to j




	def 							UpperCAmelCase__( self						:		Optional[Any]		, _SCREAMING_SNAKE_CASE						:		Optional[int]		, _SCREAMING_SNAKE_CASE						:		List[str]		, _SCREAMING_SNAKE_CASE						:		str		)->	List[str]:
			lowerCAmelCase__       :      Optional[int]   					= w




	def 							UpperCAmelCase__( self						:		List[Any]		)->	Optional[int]:
			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 							UpperCAmelCase__( self						:		str		, _SCREAMING_SNAKE_CASE						:		Any		, _SCREAMING_SNAKE_CASE						:		str		)->	str:
			return self.dp[u][v]


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




