


import warnings

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


__snake_case   							=						logging.get_logger(__name__)

__snake_case   							=						{
    '''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						):
       _lowercase											=     """xlnet"""
       _lowercase											=     ["""mems"""]
       _lowercase											=     {
           """n_token""": """vocab_size""",  # Backward compatibility
           """hidden_size""": """d_model""",
           """num_attention_heads""": """n_head""",
           """num_hidden_layers""": """n_layer""",
       }







       def __init__(			self: Tuple,A_: Optional[int]=3_2000,A_: Tuple=1024,A_: List[Any]=24,A_: Union[str, Any]=16,A_: Union[str, Any]=4096,A_: Dict="gelu",A_: Dict=True,A_: str="bi",A_: Dict=0.0_2,A_: Optional[int]=1E-12,A_: Optional[Any]=0.1,A_: Union[str, Any]=512,A_: str=None,A_: Optional[Any]=True,A_: Union[str, Any]=False,A_: int=False,A_: List[str]=-1,A_: Any=False,A_: Dict="last",A_: int=True,A_: List[str]="tanh",A_: Optional[int]=0.1,A_: int=5,A_: Any=5,A_: Optional[int]=5,A_: Tuple=1,A_: List[str]=2,**A_: List[Any],):






            '''simple docstring'''




            __UpperCamelCase =			vocab_size
            __UpperCamelCase =			d_model
            __UpperCamelCase =			n_layer
            __UpperCamelCase =			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})'''					)
            __UpperCamelCase =			d_model // n_head
            __UpperCamelCase =			ff_activation
            __UpperCamelCase =			d_inner
            __UpperCamelCase =			untie_r
            __UpperCamelCase =			attn_type

            __UpperCamelCase =			initializer_range
            __UpperCamelCase =			layer_norm_eps

            __UpperCamelCase =			dropout
            __UpperCamelCase =			mem_len
            __UpperCamelCase =			reuse_len
            __UpperCamelCase =			bi_data
            __UpperCamelCase =			clamp_len
            __UpperCamelCase =			same_length

            __UpperCamelCase =			summary_type
            __UpperCamelCase =			summary_use_proj
            __UpperCamelCase =			summary_activation
            __UpperCamelCase =			summary_last_dropout
            __UpperCamelCase =			start_n_top
            __UpperCamelCase =			end_n_top

            __UpperCamelCase =			bos_token_id
            __UpperCamelCase =			pad_token_id
            __UpperCamelCase =			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_,)
                 __UpperCamelCase =			kwargs['use_cache']

            __UpperCamelCase =			use_mems_eval
            __UpperCamelCase =			use_mems_train
            super().__init__(pad_token_id=A_,bos_token_id=A_,eos_token_id=A_,**A_					)







       @property
       def 		snake_case_	(			self: Tuple					):






            '''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 		snake_case_	(			self: int,A_: List[Any]					):






            '''simple docstring'''




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




def 	UpperCamelCase__  (     SCREAMING_SNAKE_CASE_	:	list[int]		,   SCREAMING_SNAKE_CASE_	:	int       )  ->     bool:
						_lowercase					       =					len(SCREAMING_SNAKE_CASE_       )
						_lowercase					       =					[[False] * (required_sum + 1) for _ in range(arr_len + 1       )]

						# for each arr value, a sum of zero(0) can be formed by not taking any element
						# hence True/1
						for i in range(arr_len + 1       ):
												_lowercase					       =					True

						# sum is not zero and set is empty then false
						for i in range(1		,   required_sum + 1       ):
												_lowercase					       =					False

						for i in range(1		,   arr_len + 1       ):
												for j in range(1		,   required_sum + 1       ):
																		if arr[i - 1] > j:
																								_lowercase					       =					subset[i - 1][j]
																		if arr[i - 1] <= j:
																								_lowercase					       =					subset[i - 1][j] or subset[i - 1][j - arr[i - 1]]

						return subset[arr_len][required_sum]


if __name__ == "__main__":
		import doctest

		doctest.testmod()