




'''simple docstring'''


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


_lowercase  =			logging.get_logger(__name__)

_lowercase  =			{
    """microsoft/swinv2-tiny-patch4-window8-256""": (
        """https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256/resolve/main/config.json"""
    ),
}
class 						a_				(			UpperCAmelCase__						):
	lowercase_       :     List[str]			  =      '''swinv2'''

	lowercase_       :     str			  =      {
	    '''num_attention_heads''': '''num_heads''',
	    '''num_hidden_layers''': '''num_layers''',
	}




	def __init__(       self     :  int       ,		__lowerCAmelCase     :  Optional[int]=2_2_4       ,		__lowerCAmelCase     :  Union[str, Any]=4       ,		__lowerCAmelCase     :  int=3       ,		__lowerCAmelCase     :  Any=9_6       ,		__lowerCAmelCase     :  List[Any]=[2, 2, 6, 2]       ,		__lowerCAmelCase     :  Any=[3, 6, 1_2, 2_4]       ,		__lowerCAmelCase     :  List[str]=7       ,		__lowerCAmelCase     :  List[str]=4.0       ,		__lowerCAmelCase     :  int=True       ,		__lowerCAmelCase     :  Dict=0.0       ,		__lowerCAmelCase     :  Tuple=0.0       ,		__lowerCAmelCase     :  str=0.1       ,		__lowerCAmelCase     :  List[Any]="gelu"       ,		__lowerCAmelCase     :  Union[str, Any]=False       ,		__lowerCAmelCase     :  int=0.02       ,		__lowerCAmelCase     :  Any=1E-5       ,		__lowerCAmelCase     :  List[str]=3_2       ,		**__lowerCAmelCase     :  Union[str, Any]       ,		):
							super().__init__(**__lowerCAmelCase      )

							__snake_case						 =   image_size
							__snake_case						 =   patch_size
							__snake_case						 =   num_channels
							__snake_case						 =   embed_dim
							__snake_case						 =   depths
							__snake_case						 =   len(__lowerCAmelCase      )
							__snake_case						 =   num_heads
							__snake_case						 =   window_size
							__snake_case						 =   mlp_ratio
							__snake_case						 =   qkv_bias
							__snake_case						 =   hidden_dropout_prob
							__snake_case						 =   attention_probs_dropout_prob
							__snake_case						 =   drop_path_rate
							__snake_case						 =   hidden_act
							__snake_case						 =   use_absolute_embeddings
							__snake_case						 =   layer_norm_eps
							__snake_case						 =   initializer_range
							__snake_case						 =   encoder_stride
							# we set the hidden_size attribute in order to make Swinv2 work with VisionEncoderDecoderModel
							# this indicates the channel dimension after the last stage of the model
							__snake_case						 =   int(embed_dim * 2 ** (len(__lowerCAmelCase      ) - 1)      )
							__snake_case						 =   (0, 0, 0, 0)







'''simple docstring'''


def 						lowerCamelCase__   (				a							):
						if number < 0:
												raise ValueError('number must not be negative'							)
						return number & (number - 1) == 0


if __name__ == "__main__":
	import doctest

	doctest.testmod()

