


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


lowerCAmelCase__			:      Any								=logging.get_logger(__name__)

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







class 	__lowercase    (__SCREAMING_SNAKE_CASE  ):





							"""simple docstring"""







							_UpperCAmelCase      =						"""swin2sr"""

							_UpperCAmelCase      =						{
							    """hidden_size""": """embed_dim""",
							    """num_attention_heads""": """num_heads""",
							    """num_hidden_layers""": """num_layers""",
							}






							def __init__(      self			,						lowerCAmelCase__=6_4			,						lowerCAmelCase__=1			,						lowerCAmelCase__=3			,						lowerCAmelCase__=1_8_0			,						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__       )

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









from timeit import timeit


def     lowercase	(    a ):



		'''simple docstring'''




		if number < 0:
				raise ValueError("the value of input must not be negative" )
		SCREAMING_SNAKE_CASE_				:Optional[int]				     =						0
		while number:
				number &= number - 1
				result += 1
		return result


def     lowercase	(    a ):



		'''simple docstring'''




		if number < 0:
				raise ValueError("the value of input must not be negative" )
		SCREAMING_SNAKE_CASE_				:List[Any]				     =						0
		while number:
				if number % 2 == 1:
						result += 1
				number >>= 1
		return result


def     lowercase	(    ):



		'''simple docstring'''




		def do_benchmark(a ) -> None:
				SCREAMING_SNAKE_CASE_				:List[Any]				     =						"import __main__ as z"
				print(F"Benchmark when {number = }:" )
				print(F"{get_set_bits_count_using_modulo_operator(a ) = }" )
				SCREAMING_SNAKE_CASE_				:List[Any]				     =						timeit("z.get_set_bits_count_using_modulo_operator(25)"     , setup=a )
				print(F"timeit() runs in {timing} seconds" )
				print(F"{get_set_bits_count_using_brian_kernighans_algorithm(a ) = }" )
				SCREAMING_SNAKE_CASE_				:str				     =						timeit(
				    "z.get_set_bits_count_using_brian_kernighans_algorithm(25)"     , setup=a     , )
				print(F"timeit() runs in {timing} seconds" )

		for number in (25, 37, 58, 0):
				do_benchmark(a )
				print()


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		benchmark()






