


"""simple docstring"""


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


_snake_case        =				logging.get_logger(__name__)

_snake_case        =				{
    '''funnel-transformer/small''': '''https://huggingface.co/funnel-transformer/small/resolve/main/config.json''',
    '''funnel-transformer/small-base''': '''https://huggingface.co/funnel-transformer/small-base/resolve/main/config.json''',
    '''funnel-transformer/medium''': '''https://huggingface.co/funnel-transformer/medium/resolve/main/config.json''',
    '''funnel-transformer/medium-base''': '''https://huggingface.co/funnel-transformer/medium-base/resolve/main/config.json''',
    '''funnel-transformer/intermediate''': (
        '''https://huggingface.co/funnel-transformer/intermediate/resolve/main/config.json'''
    ),
    '''funnel-transformer/intermediate-base''': (
        '''https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/config.json'''
    ),
    '''funnel-transformer/large''': '''https://huggingface.co/funnel-transformer/large/resolve/main/config.json''',
    '''funnel-transformer/large-base''': '''https://huggingface.co/funnel-transformer/large-base/resolve/main/config.json''',
    '''funnel-transformer/xlarge''': '''https://huggingface.co/funnel-transformer/xlarge/resolve/main/config.json''',
    '''funnel-transformer/xlarge-base''': '''https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/config.json''',
}



class 	_a   (   _lowercase			):
    a_     :					Optional[Any]   							=     '''funnel'''
    a_     :					Tuple   							=     {
        '''hidden_size''': '''d_model''',
        '''num_attention_heads''': '''n_head''',
    }
    def __init__(			self				:       Union[str, Any]				,       SCREAMING_SNAKE_CASE__				:       List[Any]=3_05_22				,       SCREAMING_SNAKE_CASE__				:       List[str]=[4, 4, 4]				,       SCREAMING_SNAKE_CASE__				:       Optional[int]=None				,       SCREAMING_SNAKE_CASE__				:       List[str]=2				,       SCREAMING_SNAKE_CASE__				:       Optional[Any]=7_68				,       SCREAMING_SNAKE_CASE__				:       int=12				,       SCREAMING_SNAKE_CASE__				:       List[Any]=64				,       SCREAMING_SNAKE_CASE__				:       Optional[Any]=30_72				,       SCREAMING_SNAKE_CASE__				:       str="gelu_new"				,       SCREAMING_SNAKE_CASE__				:       Optional[Any]=0.1				,       SCREAMING_SNAKE_CASE__				:       Optional[int]=0.1				,       SCREAMING_SNAKE_CASE__				:       List[Any]=0.0				,       SCREAMING_SNAKE_CASE__				:       List[str]=0.1				,       SCREAMING_SNAKE_CASE__				:       Union[str, Any]=None				,       SCREAMING_SNAKE_CASE__				:       Tuple=1e-9				,       SCREAMING_SNAKE_CASE__				:       Optional[Any]="mean"				,       SCREAMING_SNAKE_CASE__				:       Optional[int]="relative_shift"				,       SCREAMING_SNAKE_CASE__				:       List[str]=True				,       SCREAMING_SNAKE_CASE__				:       Union[str, Any]=True				,       SCREAMING_SNAKE_CASE__				:       Union[str, Any]=True				,       **SCREAMING_SNAKE_CASE__				:       Tuple				,       ):
          lowerCamelCase__							     =		vocab_size
          lowerCamelCase__							     =		block_sizes
          lowerCamelCase__							     =		[1] * len(__A					) if block_repeats is None else block_repeats
          assert len(__A					) == len(
              self.block_repeats					), "`block_sizes` and `block_repeats` should have the same length."
          lowerCamelCase__							     =		num_decoder_layers
          lowerCamelCase__							     =		d_model
          lowerCamelCase__							     =		n_head
          lowerCamelCase__							     =		d_head
          lowerCamelCase__							     =		d_inner
          lowerCamelCase__							     =		hidden_act
          lowerCamelCase__							     =		hidden_dropout
          lowerCamelCase__							     =		attention_dropout
          lowerCamelCase__							     =		activation_dropout
          lowerCamelCase__							     =		initializer_range
          lowerCamelCase__							     =		initializer_std
          lowerCamelCase__							     =		layer_norm_eps
          assert pooling_type in [
              "mean",
              "max",
          ], F'Got {pooling_type} for `pooling_type` but only \'mean\' and \'max\' are supported.'
          lowerCamelCase__							     =		pooling_type
          assert attention_type in [
              "relative_shift",
              "factorized",
          ], F'Got {attention_type} for `attention_type` but only \'relative_shift\' and \'factorized\' are supported.'
          lowerCamelCase__							     =		attention_type
          lowerCamelCase__							     =		separate_cls
          lowerCamelCase__							     =		truncate_seq
          lowerCamelCase__							     =		pool_q_only

          super().__init__(**__A					)
    @property
    def   _UpperCamelCase							(			self				:       Dict					):
          return sum(self.block_sizes					)
    @num_hidden_layers.setter
    def   _UpperCamelCase							(			self				:       Optional[Any]				,       SCREAMING_SNAKE_CASE__				:       str					):
          raise NotImplementedError(
              'This model does not support the setting of `num_hidden_layers`. Please set `block_sizes`.'					)
    @property
    def   _UpperCamelCase							(			self				:       Optional[Any]					):
          return len(self.block_sizes					)


    @num_blocks.setter
    def   _UpperCamelCase							(			self				:       List[Any]				,       SCREAMING_SNAKE_CASE__				:       List[Any]					):
          raise NotImplementedError('This model does not support the setting of `num_blocks`. Please set `block_sizes`.'					)






import math






class      lowerCamelCase_      :




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




	def        lowerCAmelCase_       (     self						:     str					,      __A						:     Union[str, Any]					,      __A						:     Any					,      __A						:     Optional[int]							):
		__A :			List[Any]		    =			w




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




	def        lowerCAmelCase_       (     self						:     int					,      __A						:     List[str]					,      __A						:     List[str]							):
		return self.dp[u][v]


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





