


"""simple docstring"""

import warnings

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


UpperCAmelCase__					=logging.get_logger(__name__)

UpperCAmelCase__					={
    "xlnet-base-cased": "https://huggingface.co/xlnet-base-cased/resolve/main/config.json",
    "xlnet-large-cased": "https://huggingface.co/xlnet-large-cased/resolve/main/config.json",
}





class  lowerCamelCase__    (		_a     ):
      a			:  int           =		"""xlnet"""
      a			:  List[Any]           =		["""mems"""]
      a			:  Any           =		{
          """n_token""": """vocab_size""",  # Backward compatibility
          """hidden_size""": """d_model""",
          """num_attention_heads""": """n_head""",
          """num_hidden_layers""": """n_layer""",
      }
      def __init__(		self						:						Optional[Any]   ,							A_						:						str=3_2_0_0_0   ,							A_						:						List[str]=1_0_2_4   ,							A_						:						Union[str, Any]=2_4   ,							A_						:						str=1_6   ,							A_						:						Union[str, Any]=4_0_9_6   ,							A_						:						List[str]="gelu"   ,							A_						:						int=True   ,							A_						:						Any="bi"   ,							A_						:						Dict=0.02   ,							A_						:						Dict=1e-1_2   ,							A_						:						Optional[Any]=0.1   ,							A_						:						Optional[int]=5_1_2   ,							A_						:						str=None   ,							A_						:						List[Any]=True   ,							A_						:						Optional[int]=False   ,							A_						:						str=False   ,							A_						:						Any=-1   ,							A_						:						Tuple=False   ,							A_						:						List[str]="last"   ,							A_						:						str=True   ,							A_						:						str="tanh"   ,							A_						:						Optional[Any]=0.1   ,							A_						:						Any=5   ,							A_						:						Union[str, Any]=5   ,							A_						:						Union[str, Any]=5   ,							A_						:						str=1   ,							A_						:						Tuple=2   ,							**A_						:						int   ,							):






       '''simple docstring'''


       __lowercase						=						vocab_size
       __lowercase						=						d_model
       __lowercase						=						n_layer
       __lowercase						=						n_head
       if d_model % n_head != 0:
        raise ValueError(F'''\'d_model % n_head\' ({d_model % n_head}) should be equal to 0'''				)
       if "d_head" in kwargs:
        if kwargs["d_head"] != d_model // n_head:
         raise ValueError(
             F'''`d_head` ({kwargs['d_head']}) should be equal to `d_model // n_head` ({d_model // n_head})'''				)
       __lowercase						=						d_model // n_head
       __lowercase						=						ff_activation
       __lowercase						=						d_inner
       __lowercase						=						untie_r
       __lowercase						=						attn_type

       __lowercase						=						initializer_range
       __lowercase						=						layer_norm_eps

       __lowercase						=						dropout
       __lowercase						=						mem_len
       __lowercase						=						reuse_len
       __lowercase						=						bi_data
       __lowercase						=						clamp_len
       __lowercase						=						same_length

       __lowercase						=						summary_type
       __lowercase						=						summary_use_proj
       __lowercase						=						summary_activation
       __lowercase						=						summary_last_dropout
       __lowercase						=						start_n_top
       __lowercase						=						end_n_top

       __lowercase						=						bos_token_id
       __lowercase						=						pad_token_id
       __lowercase						=						eos_token_id

       if "use_cache" in kwargs:
        warnings.warn(
            """The `use_cache` argument is deprecated and will be removed in a future version, use `use_mems_eval`"""
            """ instead."""   ,							A_   ,							)
        __lowercase						=						kwargs["""use_cache"""]

       __lowercase						=						use_mems_eval
       __lowercase						=						use_mems_train
       super().__init__(pad_token_id=A_   ,							bos_token_id=A_   ,							eos_token_id=A_   ,							**A_				)
      @property
      def SCREAMING_SNAKE_CASE_						(		self						:						Union[str, Any]				):






       '''simple docstring'''


       logger.info(F'''The model {self.model_type} is one of the few models that has no sequence length limit.'''				)
       return -1






      @max_position_embeddings.setter
      def SCREAMING_SNAKE_CASE_						(		self						:						Optional[int]   ,							A_						:						Tuple				):






       '''simple docstring'''


       raise NotImplementedError(
           F'''The model {self.model_type} is one of the few models that has no sequence length limit.'''				)




"""simple docstring"""

def lowerCAmelCase_   (					UpperCamelCase__						:			int			):






 """simple docstring"""







 assert (
     isinstance(UpperCamelCase__					, UpperCamelCase__			) and number_of_steps > 0
 ), f'''number_of_steps needs to be positive integer, your input {number_of_steps}'''
 if number_of_steps == 1:
  return 1
 __lowercase				,		__lowercase						=						1, 1
 for _ in range(number_of_steps - 1			):
  __lowercase				,		__lowercase						=						current + previous, current
 return current


if __name__ == "__main__":
       import doctest

       doctest.testmod()
