




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


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

lowerCamelCase__			:       int         =							{
    'google/fnet-base': 'https://huggingface.co/google/fnet-base/resolve/main/config.json',
    'google/fnet-large': 'https://huggingface.co/google/fnet-large/resolve/main/config.json'
    # See all FNet models at https://huggingface.co/models?filter=fnet
}





class 	lowerCamelCase_							(				_SCREAMING_SNAKE_CASE ):


 '''simple docstring'''







 lowercase_       =   "fnet"



 def __init__(							self  :		Optional[Any]    ,    _lowerCAmelCase  :		Any=32_000    ,    _lowerCAmelCase  :		Tuple=768    ,    _lowerCAmelCase  :		Optional[int]=12    ,    _lowerCAmelCase  :		Any=3_072    ,    _lowerCAmelCase  :		int="gelu_new"    ,    _lowerCAmelCase  :		Union[str, Any]=0.1    ,    _lowerCAmelCase  :		List[Any]=512    ,    _lowerCAmelCase  :		Union[str, Any]=4    ,    _lowerCAmelCase  :		str=0.02    ,    _lowerCAmelCase  :		Dict=1E-12    ,    _lowerCAmelCase  :		Dict=False    ,    _lowerCAmelCase  :		List[Any]=512    ,    _lowerCAmelCase  :		Tuple=3    ,    _lowerCAmelCase  :		Optional[int]=1    ,    _lowerCAmelCase  :		Any=2    ,    **_lowerCAmelCase  :		str    ,    ):
       super().__init__(pad_token_id=_lowerCAmelCase    ,    bos_token_id=_lowerCAmelCase    ,    eos_token_id=_lowerCAmelCase    ,    **_lowerCAmelCase						)

       SCREAMING_SNAKE_CASE_     						=      vocab_size
       SCREAMING_SNAKE_CASE_     						=      max_position_embeddings
       SCREAMING_SNAKE_CASE_     						=      hidden_size
       SCREAMING_SNAKE_CASE_     						=      num_hidden_layers
       SCREAMING_SNAKE_CASE_     						=      intermediate_size
       SCREAMING_SNAKE_CASE_     						=      hidden_act
       SCREAMING_SNAKE_CASE_     						=      hidden_dropout_prob
       SCREAMING_SNAKE_CASE_     						=      initializer_range
       SCREAMING_SNAKE_CASE_     						=      type_vocab_size
       SCREAMING_SNAKE_CASE_     						=      layer_norm_eps
       SCREAMING_SNAKE_CASE_     						=      use_tpu_fourier_optimizations
       SCREAMING_SNAKE_CASE_     						=      tpu_short_seq_length





def  UpperCAmelCase_							(				__UpperCAmelCase						:     Optional[Any]      ,      __UpperCAmelCase						:     Union[str, Any]							) ->			List[str]:
      SCREAMING_SNAKE_CASE_     						=      0
      while b > 0:
            if b & 1:
                  res += a

            a += a
            b >>= 1

      return res

def  UpperCAmelCase_							(				__UpperCAmelCase						:     str      ,      __UpperCAmelCase						:     int      ,      __UpperCAmelCase						:     Tuple							) ->			int:
      SCREAMING_SNAKE_CASE_     						=      0
      while b > 0:
            if b & 1:
                  SCREAMING_SNAKE_CASE_     						=      ((res % c) + (a % c)) % c

            a += a
            b >>= 1

      return res