





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


A   : List[str]			=				logging.get_logger(__name__)

A   : Optional[int]			=				{
    '''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      (SCREAMING_SNAKE_CASE   ):
			'''simple docstring'''




			__lowerCamelCase     :	Tuple          =   '''funnel'''
			__lowerCamelCase     :	Any          =   {
			    '''hidden_size''': '''d_model''',
			    '''num_attention_heads''': '''n_head''',
			}






			def __init__(      self       :   Optional[Any]							,     __lowerCAmelCase       :   List[Any]=3_05_22							,     __lowerCAmelCase       :   Dict=[4, 4, 4]							,     __lowerCAmelCase       :   Any=None							,     __lowerCAmelCase       :   Tuple=2							,     __lowerCAmelCase       :   Optional[Any]=7_68							,     __lowerCAmelCase       :   Union[str, Any]=12							,     __lowerCAmelCase       :   Tuple=64							,     __lowerCAmelCase       :   List[str]=30_72							,     __lowerCAmelCase       :   List[Any]="gelu_new"							,     __lowerCAmelCase       :   Optional[int]=0.1							,     __lowerCAmelCase       :   Optional[Any]=0.1							,     __lowerCAmelCase       :   List[str]=0.0							,     __lowerCAmelCase       :   Union[str, Any]=0.1							,     __lowerCAmelCase       :   str=None							,     __lowerCAmelCase       :   List[str]=1e-9							,     __lowerCAmelCase       :   Optional[Any]="mean"							,     __lowerCAmelCase       :   Dict="relative_shift"							,     __lowerCAmelCase       :   List[Any]=True							,     __lowerCAmelCase       :   str=True							,     __lowerCAmelCase       :   Optional[int]=True							,     **__lowerCAmelCase       :   Any							,     )     ->     int:







					"""simple docstring"""






					A__  				=       vocab_size
					A__  				=       block_sizes
					A__  				=       [1] * len(__lowerCAmelCase       ) if block_repeats is None else block_repeats
					assert len(__lowerCAmelCase       ) == len(
					    self.block_repeats       ), "`block_sizes` and `block_repeats` should have the same length."
					A__  				=       num_decoder_layers
					A__  				=       d_model
					A__  				=       n_head
					A__  				=       d_head
					A__  				=       d_inner
					A__  				=       hidden_act
					A__  				=       hidden_dropout
					A__  				=       attention_dropout
					A__  				=       activation_dropout
					A__  				=       initializer_range
					A__  				=       initializer_std
					A__  				=       layer_norm_eps
					assert pooling_type in [
					    "mean",
					    "max",
					], f'Got {pooling_type} for `pooling_type` but only \'mean\' and \'max\' are supported.'
					A__  				=       pooling_type
					assert attention_type in [
					    "relative_shift",
					    "factorized",
					], f'Got {attention_type} for `attention_type` but only \'relative_shift\' and \'factorized\' are supported.'
					A__  				=       attention_type
					A__  				=       separate_cls
					A__  				=       truncate_seq
					A__  				=       pool_q_only

					super().__init__(**__lowerCAmelCase       )






			@property
			def        a_	(      self       :   int       )     ->     Optional[int]:







					"""simple docstring"""






					return sum(self.block_sizes       )






			@num_hidden_layers.setter
			def        a_	(      self       :   int							,     __lowerCAmelCase       :   str       )     ->     List[Any]:







					"""simple docstring"""






					raise NotImplementedError(
					    """This model does not support the setting of `num_hidden_layers`. Please set `block_sizes`."""       )






			@property
			def        a_	(      self       :   Tuple       )     ->     Dict:







					"""simple docstring"""






					return len(self.block_sizes       )







			@num_blocks.setter
			def        a_	(      self       :   Union[str, Any]							,     __lowerCAmelCase       :   List[Any]       )     ->     List[str]:







					"""simple docstring"""






					raise NotImplementedError("""This model does not support the setting of `num_blocks`. Please set `block_sizes`."""       )










from string import ascii_uppercase

A   : List[str]			=				{str(ord(c) - 5_5): c for c in ascii_uppercase}







def        __lowerCamelCase (							__a       :int   ,					__a       :int   )		->    str:






		"""simple docstring"""

		if isinstance(__a   ,					__a   ):
				raise TypeError("""int() can't convert non-string with explicit base"""   )
		if num < 0:
				raise ValueError("""parameter must be positive int"""   )
		if isinstance(__a   ,					__a   ):
				raise TypeError("""'str' object cannot be interpreted as an integer"""   )
		if isinstance(__a   ,					__a   ):
				raise TypeError("""'float' object cannot be interpreted as an integer"""   )
		if base in (0, 1):
				raise ValueError("""base must be >= 2"""   )
		if base > 3_6:
				raise ValueError("""base must be <= 36"""   )
		A__  				=       """"""
		A__  				=       0
		A__  				=       0
		while div != 1:
				A__				,      A__  				=       divmod(__a   ,					__a   )
				if base >= 1_1 and 9 < mod < 3_6:
						A__  				=       ALPHABET_VALUES[str(__a   )]
				else:
						A__  				=       str(__a   )
				new_value += actual_value
				A__  				=       num // base
				A__  				=       div
				if div == 0:
						return str(new_value[::-1]   )
				elif div == 1:
						new_value += str(__a   )
						return str(new_value[::-1]   )

		return new_value[::-1]


if __name__ == "__main__":
					import doctest

					doctest.testmod()

					for base in range(2, 3_7):
										for num in range(1_0_0_0):
															assert int(decimal_to_any(num, base), base) == num, (
															    num,
															    base,
															    decimal_to_any(num, base),
															    int(decimal_to_any(num, base), base),
															)



