





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


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

UpperCAmelCase     :     List[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     __lowerCAmelCase	(   lowerCAmelCase_):
      _lowercase    : Union[str, Any]            =      """funnel"""
      _lowercase    : Optional[Any]            =      {
          """hidden_size""": """d_model""",
          """num_attention_heads""": """n_head""",
      }







      def __init__(   self		,				lowerCAmelCase__=3_0_5_2_2		,				lowerCAmelCase__=[4, 4, 4]		,				lowerCAmelCase__=None		,				lowerCAmelCase__=2		,				lowerCAmelCase__=7_6_8		,				lowerCAmelCase__=1_2		,				lowerCAmelCase__=6_4		,				lowerCAmelCase__=3_0_7_2		,				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__		,				)       ->						Tuple:



        '''simple docstring'''




        a__     : Union[str, Any]  =vocab_size
        a__     : Dict  =block_sizes
        a__     : List[str]  =[1] * len(__SCREAMING_SNAKE_CASE							) if block_repeats is None else block_repeats
        assert len(__SCREAMING_SNAKE_CASE							) == len(
            self.block_repeats							), "`block_sizes` and `block_repeats` should have the same length."
        a__     : Union[str, Any]  =num_decoder_layers
        a__     : Dict  =d_model
        a__     : List[Any]  =n_head
        a__     : int  =d_head
        a__     : Optional[int]  =d_inner
        a__     : int  =hidden_act
        a__     : Optional[Any]  =hidden_dropout
        a__     : Optional[Any]  =attention_dropout
        a__     : int  =activation_dropout
        a__     : Dict  =initializer_range
        a__     : Tuple  =initializer_std
        a__     : List[Any]  =layer_norm_eps
        assert pooling_type in [
            "mean",
            "max",
        ], F'''Got {pooling_type} for `pooling_type` but only \'mean\' and \'max\' are supported.'''
        a__     : List[str]  =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__     : List[str]  =attention_type
        a__     : int  =separate_cls
        a__     : Tuple  =truncate_seq
        a__     : Union[str, Any]  =pool_q_only

        super().__init__(**__SCREAMING_SNAKE_CASE							)







      @property
      def        _lowercase  (   self							)       ->						Any:



        '''simple docstring'''




        return sum(self.block_sizes							)







      @num_hidden_layers.setter
      def        _lowercase  (   self		,				lowerCAmelCase__							)       ->						Optional[Any]:



        '''simple docstring'''




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







      @property
      def        _lowercase  (   self							)       ->						List[Any]:



        '''simple docstring'''




        return len(self.block_sizes							)







      @num_blocks.setter
      def        _lowercase  (   self		,				lowerCAmelCase__							)       ->						str:



        '''simple docstring'''




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













from __future__ import annotations

from math import pi

# Define the Reduced Planck Constant ℏ (H bar), speed of light C, value of
# Pi and the function
UpperCAmelCase     :     Union[str, Any]							=	1.054571817E-34  # unit of ℏ : J * s

UpperCAmelCase     :     Union[str, Any]							=	3E8  # unit of c : m * s^-1
def 					_A	(		SCREAMING_SNAKE_CASE					:       float	,	SCREAMING_SNAKE_CASE					:       float	,	SCREAMING_SNAKE_CASE					:       float						):





  """simple docstring"""



  if (force, area, distance).count(0						) != 1:
    raise ValueError("One and only one argument must be 0"						)
  if force < 0:
    raise ValueError("Magnitude of force can not be negative"						)
  if distance < 0:
    raise ValueError("Distance can not be negative"						)
  if area < 0:
    raise ValueError("Area can not be negative"						)
  if force == 0:
    a__     : Tuple  =(REDUCED_PLANCK_CONSTANT * SPEED_OF_LIGHT * pi**2 * area) / (
        240 * (distance) ** 4
    )
    return {"force": force}
  elif area == 0:
    a__     : Any  =(240 * force * (distance) ** 4) / (
        REDUCED_PLANCK_CONSTANT * SPEED_OF_LIGHT * pi**2
    )
    return {"area": area}
  elif distance == 0:
    a__     : List[str]  =(
        (REDUCED_PLANCK_CONSTANT * SPEED_OF_LIGHT * pi**2 * area) / (240 * force)
    ) ** (1 / 4)
    return {"distance": distance}
  raise ValueError("One and only one argument must be 0"						)


# Run doctest
if __name__ == "__main__":
     import doctest

     doctest.testmod()






