
from typing import Callable, Optional, Union

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


UpperCAmelCase__		:     str     			=      logging.get_logger(__name__)

UpperCAmelCase__		:     Tuple     			=      {
    'microsoft/xprophetnet-large-wiki100-cased': (
        'https://huggingface.co/microsoft/xprophetnet-large-wiki100-cased/resolve/main/config.json'
    ),
}






class UpperCAmelCase   (						SCREAMING_SNAKE_CASE__   ):





   '''simple docstring'''
   __UpperCamelCase		:    Optional[int] 				=    '''xlm-prophetnet'''
   __UpperCamelCase		:    Union[str, Any] 				=    ['''past_key_values''']
   __UpperCamelCase		:    Optional[int] 				=    {
       '''num_attention_heads''': '''num_encoder_attention_heads''',
   }


   def __init__(					self     :							Tuple			,			lowerCAmelCase_     :							Optional[float] = 0.1			,			lowerCAmelCase_     :							Optional[Union[str, Callable]] = "gelu"			,			lowerCAmelCase_     :							Optional[int] = 3_0_5_2_2			,			lowerCAmelCase_     :							Optional[int] = 1_0_2_4			,			lowerCAmelCase_     :							Optional[int] = 4_0_9_6			,			lowerCAmelCase_     :							Optional[int] = 1_2			,			lowerCAmelCase_     :							Optional[int] = 1_6			,			lowerCAmelCase_     :							Optional[int] = 4_0_9_6			,			lowerCAmelCase_     :							Optional[int] = 1_2			,			lowerCAmelCase_     :							Optional[int] = 1_6			,			lowerCAmelCase_     :							Optional[float] = 0.1			,			lowerCAmelCase_     :							Optional[float] = 0.1			,			lowerCAmelCase_     :							Optional[int] = 5_1_2			,			lowerCAmelCase_     :							Optional[float] = 0.02			,			lowerCAmelCase_     :							Optional[bool] = True			,			lowerCAmelCase_     :							Optional[bool] = True			,			lowerCAmelCase_     :							Optional[int] = 0			,			lowerCAmelCase_     :							Optional[int] = 2			,			lowerCAmelCase_     :							Optional[int] = 3_2			,			lowerCAmelCase_     :							Optional[int] = 1_2_8			,			lowerCAmelCase_     :							Optional[bool] = False			,			lowerCAmelCase_     :							Optional[float] = 0.0			,			lowerCAmelCase_     :							Optional[bool] = True			,			lowerCAmelCase_     :							Optional[int] = 0			,			lowerCAmelCase_     :							Optional[int] = 1			,			lowerCAmelCase_     :							Optional[int] = 2			,			**lowerCAmelCase_     :							List[str]			,			):

      """simple docstring"""
      _A:  Optional[int]					=       vocab_size
      _A:  int					=       hidden_size
      _A:  Any					=       encoder_ffn_dim
      _A:  Any					=       num_encoder_layers
      _A:  Optional[Any]					=       num_encoder_attention_heads
      _A:  Tuple					=       decoder_ffn_dim
      _A:  str					=       num_decoder_layers
      _A:  Dict					=       num_decoder_attention_heads
      _A:  Optional[int]					=       max_position_embeddings
      _A:  int					=       init_std  # Normal(0, this parameter)
      _A:  Tuple					=       activation_function

      # parameters for xlmprophetnet
      _A:  Optional[Any]					=       ngram
      _A:  List[Any]					=       num_buckets
      _A:  int					=       relative_max_distance
      _A:  int					=       disable_ngram_loss
      _A:  List[Any]					=       eps

      # 3 Types of Dropout
      _A:  List[Any]					=       attention_dropout
      _A:  Optional[Any]					=       activation_dropout
      _A:  str					=       dropout

      _A:  List[str]					=       use_cache

      super().__init__(
          pad_token_id=lowerCAmelCase_			,			bos_token_id=lowerCAmelCase_			,			eos_token_id=lowerCAmelCase_			,			is_encoder_decoder=lowerCAmelCase_			,			add_cross_attention=lowerCAmelCase_			,			decoder_start_token_id=lowerCAmelCase_			,			**lowerCAmelCase_			,			)


   @property
   def  __magic_name__				(					self     :							List[Any]     ):

      """simple docstring"""
      return self.num_encoder_layers + self.num_decoder_layers


   @num_hidden_layers.setter
   def  __magic_name__				(					self     :							Optional[int]			,			lowerCAmelCase_     :							Union[str, Any]     ):

      """simple docstring"""
      raise NotImplementedError(
          '''This model does not support the setting of `num_hidden_layers`. Please set `num_encoder_layers` and'''
          ''' `num_decoder_layers`.'''     )





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


UpperCAmelCase__		:     Dict     			=      logging.get_logger(__name__)

UpperCAmelCase__		:     Union[str, Any]     			=      {
    'caidas/swin2sr-classicalsr-x2-64': (
        'https://huggingface.co/caidas/swin2sr-classicalsr-x2-64/resolve/main/config.json'
    ),
}






class UpperCAmelCase   (						SCREAMING_SNAKE_CASE__   ):





   '''simple docstring'''
   __UpperCamelCase		:    Dict 				=    '''swin2sr'''

   __UpperCamelCase		:    str 				=    {
       '''hidden_size''': '''embed_dim''',
       '''num_attention_heads''': '''num_heads''',
       '''num_hidden_layers''': '''num_layers''',
   }


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

      """simple docstring"""
      super().__init__(**lowerCAmelCase_     )

      _A:  List[str]					=       image_size
      _A:  Any					=       patch_size
      _A:  Any					=       num_channels
      _A:  Union[str, Any]					=       embed_dim
      _A:  int					=       depths
      _A:  List[Any]					=       len(lowerCAmelCase_     )
      _A:  int					=       num_heads
      _A:  Any					=       window_size
      _A:  Optional[int]					=       mlp_ratio
      _A:  int					=       qkv_bias
      _A:  List[Any]					=       hidden_dropout_prob
      _A:  List[str]					=       attention_probs_dropout_prob
      _A:  List[Any]					=       drop_path_rate
      _A:  Any					=       hidden_act
      _A:  List[str]					=       use_absolute_embeddings
      _A:  Tuple					=       layer_norm_eps
      _A:  str					=       initializer_range
      _A:  int					=       upscale
      _A:  int					=       img_range
      _A:  Optional[Any]					=       resi_connection
      _A:  int					=       upsampler



