



'''simple docstring'''





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


_UpperCamelCase											=						logging.get_logger(__name__)

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






class 					lowerCamelCase_    (				SCREAMING_SNAKE_CASE_     ):
  """simple docstring"""




  a_												="""transfo-xl"""
  a_												=["""mems"""]
  a_												={
      """n_token""": """vocab_size""",
      """hidden_size""": """d_model""",
      """num_attention_heads""": """n_head""",
      """num_hidden_layers""": """n_layer""",
  }




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




  @property
  def 						_lowercase     ( self      :	Tuple   )					->					List[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 						_lowercase     ( self      :	Tuple			,	_a      :	Optional[Any]   )					->					Optional[int]:
    # 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'''





_UpperCamelCase											=						tuple[float, float, float]
_UpperCamelCase											=						tuple[float, float, float]

def        a_     (							_lowerCAmelCase       ,_lowerCAmelCase       )      ->      Vectorad:
  __lowerCamelCase       :       Any           = end_pointa[0] - end_pointa[0]
  __lowerCamelCase       :       str           = end_pointa[1] - end_pointa[1]
  __lowerCamelCase       :       Tuple           = end_pointa[2] - end_pointa[2]
  return (x, y, z)

def        a_     (							_lowerCAmelCase       ,_lowerCAmelCase       )      ->      Vectorad:
  __lowerCamelCase       :       List[str]           = ab[1] * ac[2] - ab[2] * ac[1]  # *i
  __lowerCamelCase       :       Dict           = (ab[0] * ac[2] - ab[2] * ac[0]) * -1  # *j
  __lowerCamelCase       :       List[Any]           = ab[0] * ac[1] - ab[1] * ac[0]  # *k
  return (x, y, z)

def        a_     (							_lowerCAmelCase       ,_lowerCAmelCase       )      ->      bool:
  return tuple(round(_lowerCAmelCase       ,_lowerCAmelCase       ) for x in vector       ) == (0, 0, 0)


def        a_     (							_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase = 10       )      ->      bool:
  __lowerCamelCase       :       str           = create_vector(_lowerCAmelCase       ,_lowerCAmelCase       )
  __lowerCamelCase       :       Dict           = create_vector(_lowerCAmelCase       ,_lowerCAmelCase       )
  return is_zero_vector(get_ad_vectors_cross(_lowerCAmelCase       ,_lowerCAmelCase       )       ,_lowerCAmelCase       )






