






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


snake_case     					=		logging.get_logger(__name__)

snake_case     					=		{
    """transfo-xl-wt103""": """https://huggingface.co/transfo-xl-wt103/resolve/main/config.json""",
}


class 			SCREAMING_SNAKE_CASE      (      lowerCAmelCase       ):
     '''simple docstring'''


     UpperCamelCase_				:		List[str]								=						'''transfo-xl'''
     UpperCamelCase_				:		List[str]								=						['''mems''']
     UpperCamelCase_				:		Optional[Any]								=						{
         '''n_token''': '''vocab_size''',
         '''hidden_size''': '''d_model''',
         '''num_attention_heads''': '''n_head''',
         '''num_hidden_layers''': '''n_layer''',
     }


     def __init__(					self							:						Tuple       ,			UpperCAmelCase_							:						List[str]=26_7735       ,			UpperCAmelCase_							:						str=[2_0000, 4_0000, 20_0000]       ,			UpperCAmelCase_							:						Optional[int]=1024       ,			UpperCAmelCase_							:						int=1024       ,			UpperCAmelCase_							:						str=16       ,			UpperCAmelCase_							:						int=64       ,			UpperCAmelCase_							:						Union[str, Any]=4096       ,			UpperCAmelCase_							:						Optional[int]=4       ,			UpperCAmelCase_							:						Any=False       ,			UpperCAmelCase_							:						List[str]=18       ,			UpperCAmelCase_							:						List[str]=1600       ,			UpperCAmelCase_							:						Optional[Any]=1000       ,			UpperCAmelCase_							:						Tuple=True       ,			UpperCAmelCase_							:						Any=True       ,			UpperCAmelCase_							:						List[str]=0       ,			UpperCAmelCase_							:						int=-1       ,			UpperCAmelCase_							:						str=True       ,			UpperCAmelCase_							:						List[str]=0.1       ,			UpperCAmelCase_							:						Union[str, Any]=0.0       ,			UpperCAmelCase_							:						Optional[Any]=True       ,			UpperCAmelCase_							:						Union[str, Any]="normal"       ,			UpperCAmelCase_							:						Optional[Any]=0.01       ,			UpperCAmelCase_							:						Any=0.01       ,			UpperCAmelCase_							:						int=0.02       ,			UpperCAmelCase_							:						Dict=1E-5       ,			UpperCAmelCase_							:						int=0       ,			**UpperCAmelCase_							:						List[Any]       ,			):
       SCREAMING_SNAKE_CASE							:   List[Any]						    =     vocab_size
       SCREAMING_SNAKE_CASE							:   List[Any]						    =     []
       self.cutoffs.extend(UpperCAmelCase_   )
       if proj_share_all_but_first:
         SCREAMING_SNAKE_CASE							:   List[Any]						    =     [False] + [True] * len(self.cutoffs   )
       else:
         SCREAMING_SNAKE_CASE							:   Dict						    =     [False] + [False] * len(self.cutoffs   )
       SCREAMING_SNAKE_CASE							:   Dict						    =     d_model
       SCREAMING_SNAKE_CASE							:   Optional[int]						    =     d_embed
       SCREAMING_SNAKE_CASE							:   Optional[Any]						    =     d_head
       SCREAMING_SNAKE_CASE							:   Any						    =     d_inner
       SCREAMING_SNAKE_CASE							:   str						    =     div_val
       SCREAMING_SNAKE_CASE							:   str						    =     pre_lnorm
       SCREAMING_SNAKE_CASE							:   Optional[int]						    =     n_layer
       SCREAMING_SNAKE_CASE							:   Optional[int]						    =     n_head
       SCREAMING_SNAKE_CASE							:   List[str]						    =     mem_len
       SCREAMING_SNAKE_CASE							:   Optional[int]						    =     same_length
       SCREAMING_SNAKE_CASE							:   Optional[int]						    =     attn_type
       SCREAMING_SNAKE_CASE							:   List[Any]						    =     clamp_len
       SCREAMING_SNAKE_CASE							:   Dict						    =     sample_softmax
       SCREAMING_SNAKE_CASE							:   List[str]						    =     adaptive
       SCREAMING_SNAKE_CASE							:   Union[str, Any]						    =     dropout
       SCREAMING_SNAKE_CASE							:   Optional[int]						    =     dropatt
       SCREAMING_SNAKE_CASE							:   str						    =     untie_r
       SCREAMING_SNAKE_CASE							:   str						    =     init
       SCREAMING_SNAKE_CASE							:   List[Any]						    =     init_range
       SCREAMING_SNAKE_CASE							:   Union[str, Any]						    =     proj_init_std
       SCREAMING_SNAKE_CASE							:   Optional[Any]						    =     init_std
       SCREAMING_SNAKE_CASE							:   Any						    =     layer_norm_epsilon
       super().__init__(eos_token_id=UpperCAmelCase_       ,			**UpperCAmelCase_   )


     @property
     def 					_A							(					self							:						Any   ):
       # Message copied from Transformer-XL documentation
       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 					_A							(					self							:						Union[str, Any]       ,			UpperCAmelCase_							:						List[Any]   ):
       # Message copied from Transformer-XL documentation
       raise NotImplementedError(
           f'''The model {self.model_type} is one of the few models that has no sequence length limit.'''   )







"""simple docstring"""


def      lowerCamelCase_					(   __lowerCAmelCase							)				->   int:




						'''simple docstring'''



						if not isinstance(__lowerCAmelCase  ,       __lowerCAmelCase							):
												raise TypeError("only integers accepted as input"							)
						else:
												lowerCamelCase__   =str(abs(__lowerCAmelCase							)							)
												lowerCamelCase__   =[list(__lowerCAmelCase							) for char in range(len(__lowerCAmelCase							)							)]
												for index in range(len(__lowerCAmelCase							)							):
																		num_transpositions[index].pop(__lowerCAmelCase							)
												return max(
												    int("".join(list(__lowerCAmelCase							)							)							) for transposition in num_transpositions							)


if __name__ == "__main__":
	__import__('doctest').testmod()


