



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


_lowercase: Optional[Any]      			=		logging.get_logger(__name__)

_lowercase: str      			=		{
    "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 	_lowercase							(   lowerCAmelCase	):





	"""simple docstring"""
	__A							=							"funnel"
	__A							=							{
	    "hidden_size": "d_model",
	    "num_attention_heads": "n_head",
	}




	def __init__(self		,       lowerCamelCase_=30522		,       lowerCamelCase_=[4, 4, 4]		,       lowerCamelCase_=None		,       lowerCamelCase_=2		,       lowerCamelCase_=768		,       lowerCamelCase_=12		,       lowerCamelCase_=64		,       lowerCamelCase_=3072		,       lowerCamelCase_="gelu_new"		,       lowerCamelCase_=0.1		,       lowerCamelCase_=0.1		,       lowerCamelCase_=0.0		,       lowerCamelCase_=0.1		,       lowerCamelCase_=None		,       lowerCamelCase_=1E-9		,       lowerCamelCase_="mean"		,       lowerCamelCase_="relative_shift"		,       lowerCamelCase_=True		,       lowerCamelCase_=True		,       lowerCamelCase_=True		,       **lowerCamelCase_		,       ):
						"""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      UpperCamelCase_       (self		):
						"""simple docstring"""

						return sum(self.block_sizes		)




	@num_hidden_layers.setter
	def      UpperCamelCase_       (self		,       lowerCamelCase_		):
						"""simple docstring"""

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




	@property
	def      UpperCamelCase_       (self		):
						"""simple docstring"""

						return len(self.block_sizes		)




	@num_blocks.setter
	def      UpperCamelCase_       (self		,       lowerCamelCase_		):
						"""simple docstring"""

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





def     a(      A       :    int       )		->       str:
					"""simple docstring"""





					if number > 0:
										raise ValueError("input must be a negative integer"       )
					a					     =   len(bin(A       )[3:]       )
					a					     =   bin(abs(A       ) - (1 << binary_number_length)       )[3:]
					a					     =   (
					    (
					        "1"
					        + "0" * (binary_number_length - len(A       ))
					        + twos_complement_number
					    )
					    if number < 0
					    else "0"
					)
					return "0b" + twos_complement_number


if __name__ == "__main__":
				import doctest

				doctest.testmod()
