
"""simple docstring"""





from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


_a														=		logging.get_logger(__name__)

_a														=		{
    """facebook/convnextv2-tiny-1k-224""": """https://huggingface.co/facebook/convnextv2-tiny-1k-224/resolve/main/config.json""",
}






class    _UpperCAmelCase(   lowerCamelCase				,					lowerCamelCase     ):
		lowercase__      =				'convnextv2'



		def __init__( self    ,		__a=3    ,		__a=4    ,		__a=4    ,		__a=None    ,		__a=None    ,		__a="gelu"    ,		__a=0.02    ,		__a=1e-12    ,		__a=0.0    ,		__a=2_24    ,		__a=None    ,		__a=None    ,		**__a    ,		)	->	int:






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

							_UpperCamelCase										=  num_channels
							_UpperCamelCase										=  patch_size
							_UpperCamelCase										=  num_stages
							_UpperCamelCase										=  [96, 1_92, 3_84, 7_68] if hidden_sizes is None else hidden_sizes
							_UpperCamelCase										=  [3, 3, 9, 3] if depths is None else depths
							_UpperCamelCase										=  hidden_act
							_UpperCamelCase										=  initializer_range
							_UpperCamelCase										=  layer_norm_eps
							_UpperCamelCase										=  drop_path_rate
							_UpperCamelCase										=  image_size
							_UpperCamelCase										=  ['''stem'''] + [F'''stage{idx}''' for idx in range(1    ,		len(self.depths) + 1)]
							_UpperCamelCase			,  _UpperCamelCase										=  get_aligned_output_features_output_indices(
							    out_features=__a    ,		out_indices=__a    ,		stage_names=self.stage_names)








"""simple docstring"""





def 				lowerCamelCase__		(      __snake_case,					__snake_case     )							->		str:


					"""simple docstring"""





					if number < 0 or shift_amount < 0:
										raise ValueError('''both inputs must be positive integers'''     )

					_UpperCamelCase										=  str(bin(__snake_case     )     )
					binary_number += "0" * shift_amount
					return binary_number



def 				lowerCamelCase__		(      __snake_case,					__snake_case     )							->		str:


					"""simple docstring"""





					if number < 0 or shift_amount < 0:
										raise ValueError('''both inputs must be positive integers'''     )

					_UpperCamelCase										=  str(bin(__snake_case     )     )[2:]
					if shift_amount >= len(__snake_case     ):
										return "0b0"
					_UpperCamelCase										=  binary_number[: len(__snake_case     ) - shift_amount]
					return "0b" + shifted_binary_number



def 				lowerCamelCase__		(      __snake_case,					__snake_case     )							->		str:


					"""simple docstring"""





					if number >= 0:  # Get binary representation of positive number
										_UpperCamelCase										=  '''0''' + str(bin(__snake_case     )     ).strip('''-'''     )[2:]
					else:  # Get binary (2's complement) representation of negative number
										_UpperCamelCase										=  len(bin(__snake_case     )[3:]     )  # Find 2's complement of number
										_UpperCamelCase										=  bin(abs(__snake_case     ) - (1 << binary_number_length)     )[3:]
										_UpperCamelCase										=  (
										    '''1''' + '''0''' * (binary_number_length - len(__snake_case     )) + binary_number
										)

					if shift_amount >= len(__snake_case     ):
										return "0b" + binary_number[0] * len(__snake_case     )
					return (
					    "0b"
					    + binary_number[0] * shift_amount
					    + binary_number[: len(__snake_case     ) - shift_amount]
					)


if __name__ == "__main__":
				import doctest

				doctest.testmod()






