




"""simple docstring"""




import warnings

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


lowerCAmelCase							:    Any  							=							logging.get_logger(__name__)

lowerCAmelCase							:    Union[str, Any]  							=							{
    '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 					__magic_name__							( a__       ):






				'''simple docstring'''
				__UpperCamelCase    						=		"""xlnet"""
				__UpperCamelCase    						=		["""mems"""]
				__UpperCamelCase    						=		{
				    """n_token""": """vocab_size""",  # Backward compatibility
				    """hidden_size""": """d_model""",
				    """num_attention_heads""": """n_head""",
				    """num_hidden_layers""": """n_layer""",
				}





				def __init__( self	,				_a=32_000	,				_a=1_024	,				_a=24	,				_a=16	,				_a=4_096	,				_a="gelu"	,				_a=True	,				_a="bi"	,				_a=0.02	,				_a=1e-1_2	,				_a=0.1	,				_a=512	,				_a=None	,				_a=True	,				_a=False	,				_a=False	,				_a=-1	,				_a=False	,				_a="last"	,				_a=True	,				_a="tanh"	,				_a=0.1	,				_a=5	,				_a=5	,				_a=5	,				_a=1	,				_a=2	,				**_a	,				):





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

							lowerCamelCase       =      initializer_range
							lowerCamelCase       =      layer_norm_eps

							lowerCamelCase       =      dropout
							lowerCamelCase       =      mem_len
							lowerCamelCase       =      reuse_len
							lowerCamelCase       =      bi_data
							lowerCamelCase       =      clamp_len
							lowerCamelCase       =      same_length

							lowerCamelCase       =      summary_type
							lowerCamelCase       =      summary_use_proj
							lowerCamelCase       =      summary_activation
							lowerCamelCase       =      summary_last_dropout
							lowerCamelCase       =      start_n_top
							lowerCamelCase       =      end_n_top

							lowerCamelCase       =      bos_token_id
							lowerCamelCase       =      pad_token_id
							lowerCamelCase       =      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."""	,				lowercase__	,				)
										lowerCamelCase       =      kwargs['''use_cache''']

							lowerCamelCase       =      use_mems_eval
							lowerCamelCase       =      use_mems_train
							super().__init__(pad_token_id=lowercase__	,				bos_token_id=lowercase__	,				eos_token_id=lowercase__	,				**lowercase__				)





				@property
				def      _lowerCAmelCase       ( self				):





							"""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      _lowerCAmelCase       ( self	,				_a				):





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









"""simple docstring"""




from collections.abc import Sequence



def 					a__				(       snake_case__ ,				snake_case__ = False       )		->      float:
			if not arr:
						return 0

			lowerCamelCase       =      0 if allow_empty_subarrays else float("""-inf"""       )
			lowerCamelCase       =      0.0
			for num in arr:
						lowerCamelCase       =      max(0 if allow_empty_subarrays else num ,				curr_sum + num       )
						lowerCamelCase       =      max(snake_case__ ,				snake_case__       )

			return max_sum


if __name__ == "__main__":
					from doctest import testmod

					testmod()

					lowerCAmelCase							:    Optional[int]  							=							[-2, 1, -3, 4, -1, 2, 1, -5, 4]
					print(F"""{max_subarray_sum(nums) = }""")



