

"""simple docstring"""




import warnings

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


A_							:			Tuple											= logging.get_logger(__name__)

A_							:			List[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    lowerCamelCase						(A__			):
			lowerCamelCase__   :		Union[str, Any]							=							'xlnet'
			lowerCamelCase__   :		List[str]							=							['mems']
			lowerCamelCase__   :		Tuple							=							{
			    'n_token': 'vocab_size',  # Backward compatibility
			    'hidden_size': 'd_model',
			    'num_attention_heads': 'n_head',
			    'num_hidden_layers': 'n_layer',
			}

			def __init__(					self				:						Optional[int]    ,				__UpperCAmelCase				:						Any=3_2_0_0_0    ,				__UpperCAmelCase				:						Optional[Any]=1_0_2_4    ,				__UpperCAmelCase				:						Tuple=2_4    ,				__UpperCAmelCase				:						Optional[Any]=1_6    ,				__UpperCAmelCase				:						List[Any]=4_0_9_6    ,				__UpperCAmelCase				:						Optional[int]="gelu"    ,				__UpperCAmelCase				:						Dict=True    ,				__UpperCAmelCase				:						Optional[int]="bi"    ,				__UpperCAmelCase				:						List[str]=0.02    ,				__UpperCAmelCase				:						Any=1e-12    ,				__UpperCAmelCase				:						str=0.1    ,				__UpperCAmelCase				:						int=5_1_2    ,				__UpperCAmelCase				:						List[str]=None    ,				__UpperCAmelCase				:						Any=True    ,				__UpperCAmelCase				:						List[str]=False    ,				__UpperCAmelCase				:						Optional[Any]=False    ,				__UpperCAmelCase				:						List[str]=-1    ,				__UpperCAmelCase				:						Optional[Any]=False    ,				__UpperCAmelCase				:						Dict="last"    ,				__UpperCAmelCase				:						List[str]=True    ,				__UpperCAmelCase				:						Optional[int]="tanh"    ,				__UpperCAmelCase				:						Tuple=0.1    ,				__UpperCAmelCase				:						int=5    ,				__UpperCAmelCase				:						Tuple=5    ,				__UpperCAmelCase				:						Any=5    ,				__UpperCAmelCase				:						Optional[int]=1    ,				__UpperCAmelCase				:						List[Any]=2    ,				**__UpperCAmelCase				:						Union[str, Any]    ,				)   ->    Tuple:
						SCREAMING_SNAKE_CASE__								=      vocab_size
						SCREAMING_SNAKE_CASE__								=      d_model
						SCREAMING_SNAKE_CASE__								=      n_layer
						SCREAMING_SNAKE_CASE__								=      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})"""       )
						SCREAMING_SNAKE_CASE__								=      d_model // n_head
						SCREAMING_SNAKE_CASE__								=      ff_activation
						SCREAMING_SNAKE_CASE__								=      d_inner
						SCREAMING_SNAKE_CASE__								=      untie_r
						SCREAMING_SNAKE_CASE__								=      attn_type

						SCREAMING_SNAKE_CASE__								=      initializer_range
						SCREAMING_SNAKE_CASE__								=      layer_norm_eps

						SCREAMING_SNAKE_CASE__								=      dropout
						SCREAMING_SNAKE_CASE__								=      mem_len
						SCREAMING_SNAKE_CASE__								=      reuse_len
						SCREAMING_SNAKE_CASE__								=      bi_data
						SCREAMING_SNAKE_CASE__								=      clamp_len
						SCREAMING_SNAKE_CASE__								=      same_length

						SCREAMING_SNAKE_CASE__								=      summary_type
						SCREAMING_SNAKE_CASE__								=      summary_use_proj
						SCREAMING_SNAKE_CASE__								=      summary_activation
						SCREAMING_SNAKE_CASE__								=      summary_last_dropout
						SCREAMING_SNAKE_CASE__								=      start_n_top
						SCREAMING_SNAKE_CASE__								=      end_n_top

						SCREAMING_SNAKE_CASE__								=      bos_token_id
						SCREAMING_SNAKE_CASE__								=      pad_token_id
						SCREAMING_SNAKE_CASE__								=      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."""    ,				__UpperCAmelCase    ,				)
									SCREAMING_SNAKE_CASE__								=      kwargs["""use_cache"""]

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

			@property
			def 					SCREAMING_SNAKE_CASE				(					self				:						Optional[int]       )   ->    Any:
						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 					SCREAMING_SNAKE_CASE				(					self				:						Optional[Any]    ,				__UpperCAmelCase				:						Optional[Any]       )   ->    List[Any]:
						# 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


A_							:			Union[str, Any]											= logging.get_logger(__name__)

A_							:			int											= {
    "caidas/swin2sr-classicalsr-x2-64": (
        "https://huggingface.co/caidas/swin2sr-classicalsr-x2-64/resolve/main/config.json"
    ),
}





class    lowerCamelCase						(A__			):
			lowerCamelCase__   :		List[str]							=							'swin2sr'

			lowerCamelCase__   :		Optional[Any]							=							{
			    'hidden_size': 'embed_dim',
			    'num_attention_heads': 'num_heads',
			    'num_hidden_layers': 'num_layers',
			}

			def __init__(					self				:						Tuple    ,				__UpperCAmelCase				:						Optional[int]=6_4    ,				__UpperCAmelCase				:						Tuple=1    ,				__UpperCAmelCase				:						Optional[Any]=3    ,				__UpperCAmelCase				:						List[str]=1_8_0    ,				__UpperCAmelCase				:						List[str]=[6, 6, 6, 6, 6, 6]    ,				__UpperCAmelCase				:						Optional[Any]=[6, 6, 6, 6, 6, 6]    ,				__UpperCAmelCase				:						Tuple=8    ,				__UpperCAmelCase				:						Union[str, Any]=2.0    ,				__UpperCAmelCase				:						int=True    ,				__UpperCAmelCase				:						Optional[Any]=0.0    ,				__UpperCAmelCase				:						str=0.0    ,				__UpperCAmelCase				:						Dict=0.1    ,				__UpperCAmelCase				:						Dict="gelu"    ,				__UpperCAmelCase				:						Tuple=False    ,				__UpperCAmelCase				:						List[str]=0.02    ,				__UpperCAmelCase				:						List[Any]=1e-5    ,				__UpperCAmelCase				:						str=2    ,				__UpperCAmelCase				:						Optional[int]=1.0    ,				__UpperCAmelCase				:						Union[str, Any]="1conv"    ,				__UpperCAmelCase				:						List[Any]="pixelshuffle"    ,				**__UpperCAmelCase				:						Any    ,				)   ->    Optional[int]:
						super().__init__(**__UpperCAmelCase       )

						SCREAMING_SNAKE_CASE__								=      image_size
						SCREAMING_SNAKE_CASE__								=      patch_size
						SCREAMING_SNAKE_CASE__								=      num_channels
						SCREAMING_SNAKE_CASE__								=      embed_dim
						SCREAMING_SNAKE_CASE__								=      depths
						SCREAMING_SNAKE_CASE__								=      len(__UpperCAmelCase       )
						SCREAMING_SNAKE_CASE__								=      num_heads
						SCREAMING_SNAKE_CASE__								=      window_size
						SCREAMING_SNAKE_CASE__								=      mlp_ratio
						SCREAMING_SNAKE_CASE__								=      qkv_bias
						SCREAMING_SNAKE_CASE__								=      hidden_dropout_prob
						SCREAMING_SNAKE_CASE__								=      attention_probs_dropout_prob
						SCREAMING_SNAKE_CASE__								=      drop_path_rate
						SCREAMING_SNAKE_CASE__								=      hidden_act
						SCREAMING_SNAKE_CASE__								=      use_absolute_embeddings
						SCREAMING_SNAKE_CASE__								=      layer_norm_eps
						SCREAMING_SNAKE_CASE__								=      initializer_range
						SCREAMING_SNAKE_CASE__								=      upscale
						SCREAMING_SNAKE_CASE__								=      img_range
						SCREAMING_SNAKE_CASE__								=      resi_connection
						SCREAMING_SNAKE_CASE__								=      upsampler


