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


_UpperCAmelCase :			str              =	logging.get_logger(__name__)

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


class     lowercase (		_SCREAMING_SNAKE_CASE       ):
		__lowercase	:	str     					=    "swin2sr"

		__lowercase	:	str     					=    {
		    "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_    ,				)  -> List[Any]:
				"""simple docstring"""
				super().__init__(**A_	)

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


from __future__ import annotations


def 				A	( lowercase   ,	lowercase			)       ->  tuple[int, int]:
		'''simple docstring'''

		if b == 0:
				return (1, 0)
		((UpperCamelCase)     ,  (UpperCamelCase))          =					extended_euclid(lowercase   ,	a % b			)
		UpperCamelCase          =					a // b
		return (y, x - k * y)


def 				A	( lowercase   ,	lowercase   ,	lowercase   ,	lowercase			)       ->  int:
		'''simple docstring'''

		((UpperCamelCase)     ,  (UpperCamelCase))          =					extended_euclid(lowercase   ,	lowercase			)
		UpperCamelCase          =					na * na
		UpperCamelCase          =					ra * x * na + ra * y * na
		return (n % m + m) % m


def 				A	( lowercase   ,	lowercase			)       ->  int:
		'''simple docstring'''

		((UpperCamelCase)     ,  (UpperCamelCase))          =					extended_euclid(lowercase   ,	lowercase			)
		if b < 0:
				UpperCamelCase          =					(b % n + n) % n
		return b


def 				A	( lowercase   ,	lowercase   ,	lowercase   ,	lowercase			)       ->  int:
		'''simple docstring'''

		UpperCamelCase     ,  UpperCamelCase          =					invert_modulo(lowercase   ,	lowercase			), invert_modulo(lowercase   ,	lowercase			)
		UpperCamelCase          =					na * na
		UpperCamelCase          =					ra * x * na + ra * y * na
		return (n % m + m) % m


if __name__ == "__main__":
					from doctest import testmod

					testmod(name="chinese_remainder_theorem", verbose=True)
					testmod(name="chinese_remainder_theorem2", verbose=True)
					testmod(name="invert_modulo", verbose=True)
					testmod(name="extended_euclid", verbose=True)
