
'''simple docstring'''
from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowercase__											=logging.get_logger(__name__)

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







class   a_ (      UpperCamelCase__					):
			lowerCamelCase__	:			Optional[Any]       =    'transfo-xl'
			lowerCamelCase__	:			int       =    ['mems']
			lowerCamelCase__	:			int       =    {
			    'n_token': 'vocab_size',
			    'hidden_size': 'd_model',
			    'num_attention_heads': 'n_head',
			    'num_hidden_layers': 'n_layer',
			}




			def __init__(       self					,   UpperCAmelCase=26_77_35					,   UpperCAmelCase=[2_00_00, 4_00_00, 20_00_00]					,   UpperCAmelCase=10_24					,   UpperCAmelCase=10_24					,   UpperCAmelCase=16					,   UpperCAmelCase=64					,   UpperCAmelCase=40_96					,   UpperCAmelCase=4					,   UpperCAmelCase=False					,   UpperCAmelCase=18					,   UpperCAmelCase=16_00					,   UpperCAmelCase=10_00					,   UpperCAmelCase=True					,   UpperCAmelCase=True					,   UpperCAmelCase=0					,   UpperCAmelCase=-1					,   UpperCAmelCase=True					,   UpperCAmelCase=0.1					,   UpperCAmelCase=0.0					,   UpperCAmelCase=True					,   UpperCAmelCase="normal"					,   UpperCAmelCase=0.01					,   UpperCAmelCase=0.01					,   UpperCAmelCase=0.02					,   UpperCAmelCase=1e-5					,   UpperCAmelCase=0					,   **UpperCAmelCase					,   ):
				a_      				=						vocab_size
				a_      				=						[]
				self.cutoffs.extend(UpperCAmelCase	)
				if proj_share_all_but_first:
					a_      				=						[False] + [True] * len(self.cutoffs	)
				else:
					a_      				=						[False] + [False] * len(self.cutoffs	)
				a_      				=						d_model
				a_      				=						d_embed
				a_      				=						d_head
				a_      				=						d_inner
				a_      				=						div_val
				a_      				=						pre_lnorm
				a_      				=						n_layer
				a_      				=						n_head
				a_      				=						mem_len
				a_      				=						same_length
				a_      				=						attn_type
				a_      				=						clamp_len
				a_      				=						sample_softmax
				a_      				=						adaptive
				a_      				=						dropout
				a_      				=						dropatt
				a_      				=						untie_r
				a_      				=						init
				a_      				=						init_range
				a_      				=						proj_init_std
				a_      				=						init_std
				a_      				=						layer_norm_epsilon
				super().__init__(eos_token_id=UpperCAmelCase					,   **UpperCAmelCase	)




			@property
			def 					lowerCAmelCase__					(       self	):
				# 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 					lowerCAmelCase__					(       self					,   UpperCAmelCase	):
				# 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'''
import math






def      UpperCamelCase_				(      A__						):
	return math.sqrt(A__						) * math.sqrt(A__						) == num






def      UpperCamelCase_				(      A__						):
	a_      				=						0
	a_      				=						n
	while left <= right:
		a_      				=						(left + right) // 2
		if mid**2 == n:
			return True
		elif mid**2 > n:
			a_      				=						mid - 1
		else:
			a_      				=						mid + 1
	return False


if __name__ == "__main__":
		import doctest

		doctest.testmod()
