



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


_snake_case	=						logging.get_logger(__name__)

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



class 						UpperCAmelCase_					( a):
							lowerCamelCase__         =	'swin2sr'

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







							def __init__(     self,    __a=64,    __a=1,    __a=3,    __a=180,    __a=[6, 6, 6, 6, 6, 6],    __a=[6, 6, 6, 6, 6, 6],    __a=8,    __a=2.0,    __a=True,    __a=0.0,    __a=0.0,    __a=0.1,    __a="gelu",    __a=False,    __a=0.02,    __a=1E-5,    __a=2,    __a=1.0,    __a="1conv",    __a="pixelshuffle",    **__a,    ):

														'''simple docstring'''

														super().__init__(**__a)

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






import copy

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


_snake_case	=						logging.get_logger(__name__)



class 						UpperCAmelCase_					( a):
							lowerCamelCase__         =	'upernet'







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

														'''simple docstring'''

														super().__init__(**__a)

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

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







							def      snake_case__   (     self):

														'''simple docstring'''

														_lowerCAmelCase  :							Any				     =					copy.deepcopy(self.__dict__)
														_lowerCAmelCase  :							List[Any]				     =					self.backbone_config.to_dict()
														_lowerCAmelCase  :							Optional[Any]				     =					self.__class__.model_type
														return output
