

"""simple docstring"""




import warnings

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


_lowercase   :	List[str]												=						logging.get_logger(__name__)

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



	def __init__(  self     :       Tuple			,    _lowercase     :       Union[str, Any]=3_20_00			,    _lowercase     :       Dict=10_24			,    _lowercase     :       List[str]=24			,    _lowercase     :       int=16			,    _lowercase     :       Any=40_96			,    _lowercase     :       Tuple="gelu"			,    _lowercase     :       Union[str, Any]=True			,    _lowercase     :       Optional[Any]="bi"			,    _lowercase     :       Dict=0.02			,    _lowercase     :       int=1E-12			,    _lowercase     :       Tuple=0.1			,    _lowercase     :       Any=5_12			,    _lowercase     :       Any=None			,    _lowercase     :       List[str]=True			,    _lowercase     :       List[Any]=False			,    _lowercase     :       Optional[int]=False			,    _lowercase     :       List[str]=-1			,    _lowercase     :       Dict=False			,    _lowercase     :       str="last"			,    _lowercase     :       str=True			,    _lowercase     :       Dict="tanh"			,    _lowercase     :       str=0.1			,    _lowercase     :       int=5			,    _lowercase     :       Union[str, Any]=5			,    _lowercase     :       List[str]=5			,    _lowercase     :       Union[str, Any]=1			,    _lowercase     :       int=2			,    **_lowercase     :       Dict			,    ):
		__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.'''			,    _lowercase			,    )
			__UpperCAmelCase      		= kwargs['''use_cache''']

		__UpperCAmelCase      		= use_mems_eval
		__UpperCAmelCase      		= use_mems_train
		super().__init__(pad_token_id=_lowercase			,    bos_token_id=_lowercase			,    eos_token_id=_lowercase			,    **_lowercase						)



	@property
	def        a  (  self     :       Optional[int]						):
		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     :       Tuple			,    _lowercase     :       Dict						):
		# 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"""


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


__magic_name__       :					Dict						=			logging.get_logger(__name__)

__magic_name__       :					List[str]						=			{
    """microsoft/swinv2-tiny-patch4-window8-256""": (
        """https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256/resolve/main/config.json"""
    ),
}






class 							lowercase__			(   __SCREAMING_SNAKE_CASE	):

			"""simple docstring"""
			__lowerCAmelCase     :				List[str]										=  """swinv2"""

			__lowerCAmelCase     :				Optional[Any]										=  {
			    """num_attention_heads""": """num_heads""",
			    """num_hidden_layers""": """num_layers""",
			}







			def __init__(      self						,   _A=2_2_4						,   _A=4						,   _A=3						,   _A=9_6						,   _A=[2, 2, 6, 2]						,   _A=[3, 6, 1_2, 2_4]						,   _A=7						,   _A=4.0						,   _A=True						,   _A=0.0						,   _A=0.0						,   _A=0.1						,   _A="gelu"						,   _A=False						,   _A=0.02						,   _A=1e-5						,   _A=3_2						,   **_A						,   ):






									'''simple docstring'''







									super().__init__(**_A    )

									UpperCamelCase				:		Optional[Any]				   =			image_size
									UpperCamelCase				:		Tuple				   =			patch_size
									UpperCamelCase				:		str				   =			num_channels
									UpperCamelCase				:		Dict				   =			embed_dim
									UpperCamelCase				:		List[str]				   =			depths
									UpperCamelCase				:		Optional[Any]				   =			len(_A    )
									UpperCamelCase				:		Optional[int]				   =			num_heads
									UpperCamelCase				:		Optional[int]				   =			window_size
									UpperCamelCase				:		List[Any]				   =			mlp_ratio
									UpperCamelCase				:		str				   =			qkv_bias
									UpperCamelCase				:		str				   =			hidden_dropout_prob
									UpperCamelCase				:		Tuple				   =			attention_probs_dropout_prob
									UpperCamelCase				:		List[Any]				   =			drop_path_rate
									UpperCamelCase				:		str				   =			hidden_act
									UpperCamelCase				:		Optional[Any]				   =			use_absolute_embeddings
									UpperCamelCase				:		Dict				   =			layer_norm_eps
									UpperCamelCase				:		Dict				   =			initializer_range
									UpperCamelCase				:		str				   =			encoder_stride
									# we set the hidden_size attribute in order to make Swinv2 work with VisionEncoderDecoderModel
									# this indicates the channel dimension after the last stage of the model
									UpperCamelCase				:		Any				   =			int(embed_dim * 2 ** (len(_A    ) - 1)    )
									UpperCamelCase				:		str				   =			(0, 0, 0, 0)



