



"""simple docstring"""






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


__UpperCAmelCase   :   Union[str, Any]        =       logging.get_logger(__name__)

__UpperCAmelCase   :   Optional[Any]        =       {
    '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				(A__	):


					'''simple docstring'''


					a__          =  """funnel"""
					a__          =  {
					    """hidden_size""": """d_model""",
					    """num_attention_heads""": """n_head""",
					}







					def __init__(   self     ,							a=3_05_22     ,							a=[4, 4, 4]     ,							a=None     ,							a=2     ,							a=7_68     ,							a=12     ,							a=64     ,							a=30_72     ,							a="gelu_new"     ,							a=0.1     ,							a=0.1     ,							a=0.0     ,							a=0.1     ,							a=None     ,							a=1e-9     ,							a="mean"     ,							a="relative_shift"     ,							a=True     ,							a=True     ,							a=True     ,							**a     ,							):




										"""simple docstring"""





										snake_case_    :List[str]										=    vocab_size
										snake_case_    :str										=    block_sizes
										snake_case_    :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."
										snake_case_    :Dict										=    num_decoder_layers
										snake_case_    :Union[str, Any]										=    d_model
										snake_case_    :Optional[Any]										=    n_head
										snake_case_    :List[Any]										=    d_head
										snake_case_    :List[Any]										=    d_inner
										snake_case_    :List[str]										=    hidden_act
										snake_case_    :Optional[Any]										=    hidden_dropout
										snake_case_    :Optional[Any]										=    attention_dropout
										snake_case_    :List[Any]										=    activation_dropout
										snake_case_    :int										=    initializer_range
										snake_case_    :str										=    initializer_std
										snake_case_    :Any										=    layer_norm_eps
										assert pooling_type in [
										    "mean",
										    "max",
										], F'''Got {pooling_type} for `pooling_type` but only \'mean\' and \'max\' are supported.'''
										snake_case_    :Dict										=    pooling_type
										assert attention_type in [
										    "relative_shift",
										    "factorized",
										], F'''Got {attention_type} for `attention_type` but only \'relative_shift\' and \'factorized\' are supported.'''
										snake_case_    :str										=    attention_type
										snake_case_    :int										=    separate_cls
										snake_case_    :List[Any]										=    truncate_seq
										snake_case_    :List[Any]										=    pool_q_only

										super().__init__(**_UpperCamelCase )







					@property
					def 		_a			(   self ):




										"""simple docstring"""





										return sum(self.block_sizes )







					@num_hidden_layers.setter
					def 		_a			(   self     ,							a ):




										"""simple docstring"""





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







					@property
					def 		_a			(   self ):




										"""simple docstring"""





										return len(self.block_sizes )







					@num_blocks.setter
					def 		_a			(   self     ,							a ):




										"""simple docstring"""





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








import numpy as np
def      A__       (    SCREAMING_SNAKE_CASE_   :      np.ndarray				,	SCREAMING_SNAKE_CASE_   :      float						)  ->  np.ndarray:






   """simple docstring"""







   return np.where(vector > 0				,	SCREAMING_SNAKE_CASE_				,	(alpha * (np.exp(SCREAMING_SNAKE_CASE_						) - 1))						)


if __name__ == "__main__":
   import doctest

   doctest.testmod()