






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


__UpperCAmelCase								=						logging.get_logger(__name__)

__UpperCAmelCase								=						{
    '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   lowerCamelCase      (_snake_case			):







		'''simple docstring'''



		_snake_case    :    Union[str, Any]       						=  '''funnel'''
		_snake_case    :    int       						=  {
		    '''hidden_size''': '''d_model''',
		    '''num_attention_heads''': '''n_head''',
		}



		def __init__(							self				,		_UpperCamelCase=3_0_5_2_2				,		_UpperCamelCase=[4, 4, 4]				,		_UpperCamelCase=None				,		_UpperCamelCase=2				,		_UpperCamelCase=7_6_8				,		_UpperCamelCase=1_2				,		_UpperCamelCase=6_4				,		_UpperCamelCase=3_0_7_2				,		_UpperCamelCase="gelu_new"				,		_UpperCamelCase=0.1				,		_UpperCamelCase=0.1				,		_UpperCamelCase=0.0				,		_UpperCamelCase=0.1				,		_UpperCamelCase=None				,		_UpperCamelCase=1E-9				,		_UpperCamelCase="mean"				,		_UpperCamelCase="relative_shift"				,		_UpperCamelCase=True				,		_UpperCamelCase=True				,		_UpperCamelCase=True				,		**_UpperCamelCase				,		)	->							Optional[Any]:
							UpperCAmelCase_    :      Optional[Any]            =						vocab_size
							UpperCAmelCase_    :      Union[str, Any]            =						block_sizes
							UpperCAmelCase_    :      Tuple            =						[1] * len(_UpperCamelCase   ) if block_repeats is None else block_repeats
							assert len(_UpperCamelCase   ) == len(
							    self.block_repeats   ), "`block_sizes` and `block_repeats` should have the same length."
							UpperCAmelCase_    :      List[Any]            =						num_decoder_layers
							UpperCAmelCase_    :      Union[str, Any]            =						d_model
							UpperCAmelCase_    :      Any            =						n_head
							UpperCAmelCase_    :      List[str]            =						d_head
							UpperCAmelCase_    :      Dict            =						d_inner
							UpperCAmelCase_    :      Dict            =						hidden_act
							UpperCAmelCase_    :      List[str]            =						hidden_dropout
							UpperCAmelCase_    :      Optional[int]            =						attention_dropout
							UpperCAmelCase_    :      Any            =						activation_dropout
							UpperCAmelCase_    :      str            =						initializer_range
							UpperCAmelCase_    :      Dict            =						initializer_std
							UpperCAmelCase_    :      Optional[Any]            =						layer_norm_eps
							assert pooling_type in [
							    "mean",
							    "max",
							], f"Got {pooling_type} for `pooling_type` but only 'mean' and 'max' are supported."
							UpperCAmelCase_    :      Optional[int]            =						pooling_type
							assert attention_type in [
							    "relative_shift",
							    "factorized",
							], f"Got {attention_type} for `attention_type` but only 'relative_shift' and 'factorized' are supported."
							UpperCAmelCase_    :      List[Any]            =						attention_type
							UpperCAmelCase_    :      Optional[Any]            =						separate_cls
							UpperCAmelCase_    :      int            =						truncate_seq
							UpperCAmelCase_    :      str            =						pool_q_only

							super().__init__(**_UpperCamelCase   )



		@property
		def 					__UpperCAmelCase			(							self   )	->							List[str]:
							return sum(self.block_sizes   )



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



		@property
		def 					__UpperCAmelCase			(							self   )	->							Tuple:
							return len(self.block_sizes   )



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










"""simple docstring"""
def 		lowercase							(     _snake_case						:      int     ,   _snake_case						:      int     )     ->str:
	"""simple docstring"""





	if a < 0 or b < 0:
		raise ValueError('''the value of both inputs must be positive'''     )
	__snake_case	:						Tuple						=				str(bin(_snake_case     )     )[2:]  # remove the leading "0b"
	__snake_case	:						List[Any]						=				str(bin(_snake_case     )     )[2:]
	__snake_case	:						Any						=				max(len(_snake_case     )     ,   len(_snake_case     )     )
	return "0b" + "".join(
	    str(int('''1''' in (char_a, char_b)     )     )
	    for char_a, char_b in zip(a_binary.zfill(_snake_case     )     ,   b_binary.zfill(_snake_case     )     )     )


if __name__ == "__main__":
			import doctest

			doctest.testmod()





