






import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import CONFIG_MAPPING


_a        =			logging.get_logger(__name__)







class 	_UpperCAmelCase  (  _A		):




      """simple docstring"""



      A          =    "upernet"
      def __init__(   self    ,	_lowerCAmelCase=None    ,	_lowerCAmelCase=512    ,	_lowerCAmelCase=0.02    ,	_lowerCAmelCase=[1, 2, 3, 6]    ,	_lowerCAmelCase=True    ,	_lowerCAmelCase=0.4    ,	_lowerCAmelCase=384    ,	_lowerCAmelCase=256    ,	_lowerCAmelCase=1    ,	_lowerCAmelCase=False    ,	_lowerCAmelCase=255    ,	**_lowerCAmelCase    ,	):



          '''simple docstring'''
          super().__init__(**UpperCamelCase__		)

          if backbone_config is None:
              logger.info("`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone."		)
              lowerCAmelCase__   :int      							=				CONFIG_MAPPING["resnet"](out_features=["stage1", "stage2", "stage3", "stage4"]		)
          elif isinstance(UpperCamelCase__    ,	UpperCamelCase__		):
              lowerCAmelCase__   :Optional[Any]      							=				backbone_config.get("model_type"		)
              lowerCAmelCase__   :List[Any]      							=				CONFIG_MAPPING[backbone_model_type]
              lowerCAmelCase__   :Tuple      							=				config_class.from_dict(UpperCamelCase__		)

          lowerCAmelCase__   :Union[str, Any]      							=				backbone_config
          lowerCAmelCase__   :Dict      							=				hidden_size
          lowerCAmelCase__   :Optional[Any]      							=				initializer_range
          lowerCAmelCase__   :List[str]      							=				pool_scales
          lowerCAmelCase__   :Dict      							=				use_auxiliary_head
          lowerCAmelCase__   :List[Any]      							=				auxiliary_loss_weight
          lowerCAmelCase__   :Union[str, Any]      							=				auxiliary_in_channels
          lowerCAmelCase__   :int      							=				auxiliary_channels
          lowerCAmelCase__   :int      							=				auxiliary_num_convs
          lowerCAmelCase__   :Optional[int]      							=				auxiliary_concat_input
          lowerCAmelCase__   :Optional[int]      							=				loss_ignore_index



      def 			snake_case_      (   self		):



          '''simple docstring'''
          lowerCAmelCase__   :Union[str, Any]      							=				copy.deepcopy(self.__dict__		)
          lowerCAmelCase__   :int      							=				self.backbone_config.to_dict()
          lowerCAmelCase__   :List[Any]      							=				self.__class__.model_type
          return output











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


_a    :   Dict        =			logging.get_logger(__name__)

_a    :   Optional[Any]        =			{
    """caidas/swin2sr-classicalsr-x2-64""": (
        """https://huggingface.co/caidas/swin2sr-classicalsr-x2-64/resolve/main/config.json"""
    ),
}







class 	_UpperCAmelCase  (  _A		):




      """simple docstring"""



      A          =    '''swin2sr'''

      A          =    {
          '''hidden_size''': '''embed_dim''',
          '''num_attention_heads''': '''num_heads''',
          '''num_hidden_layers''': '''num_layers''',
      }
      def __init__(   self    ,	_lowerCAmelCase=64    ,	_lowerCAmelCase=1    ,	_lowerCAmelCase=3    ,	_lowerCAmelCase=180    ,	_lowerCAmelCase=[6, 6, 6, 6, 6, 6]    ,	_lowerCAmelCase=[6, 6, 6, 6, 6, 6]    ,	_lowerCAmelCase=8    ,	_lowerCAmelCase=2.0    ,	_lowerCAmelCase=True    ,	_lowerCAmelCase=0.0    ,	_lowerCAmelCase=0.0    ,	_lowerCAmelCase=0.1    ,	_lowerCAmelCase="gelu"    ,	_lowerCAmelCase=False    ,	_lowerCAmelCase=0.02    ,	_lowerCAmelCase=1e-5    ,	_lowerCAmelCase=2    ,	_lowerCAmelCase=1.0    ,	_lowerCAmelCase="1conv"    ,	_lowerCAmelCase="pixelshuffle"    ,	**_lowerCAmelCase    ,	):



          '''simple docstring'''
          super().__init__(**_lowerCAmelCase		)

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



