


'''simple docstring'''






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


a_   :      int				    =      logging.get_logger(__name__)

a_   :      Optional[Any]				    =      {
    "facebook/convnextv2-tiny-1k-224": "https://huggingface.co/facebook/convnextv2-tiny-1k-224/resolve/main/config.json",
}




class 	a       (       _SCREAMING_SNAKE_CASE					,			_SCREAMING_SNAKE_CASE    ):
 _lowerCAmelCase	   =		"""convnextv2"""
 def __init__(	self ,			__magic_name__=3 ,			__magic_name__=4 ,			__magic_name__=4 ,			__magic_name__=None ,			__magic_name__=None ,			__magic_name__="gelu" ,			__magic_name__=0.0_2 ,			__magic_name__=1e-12 ,			__magic_name__=0.0 ,			__magic_name__=2_24 ,			__magic_name__=None ,			__magic_name__=None ,			**__magic_name__ ,			)   ->							Union[str, Any]:
      super().__init__(**__magic_name__  )

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





'''simple docstring'''






from timeit import timeit






def 		_A			(lowerCAmelCase__					:int						)				->					int:




     '''simple docstring'''



     if number < 0:
          raise ValueError('the value of input must not be negative'						)
     _a      =							0
     while number:
          number &= number - 1
          result += 1
     return result






def 		_A			(lowerCAmelCase__					:int						)				->					int:




     '''simple docstring'''



     if number < 0:
          raise ValueError('the value of input must not be negative'						)
     _a      =							0
     while number:
          if number % 2 == 1:
               result += 1
          number >>= 1
     return result






def 		_A			()				->					None:




     '''simple docstring'''



     def do_benchmark(lowerCAmelCase__					:int						) -> None:
          _a      =							'import __main__ as z'
          print(f'Benchmark when {number = }:'						)
          print(f'{get_set_bits_count_using_modulo_operator(lowerCAmelCase__						) = }'						)
          _a      =							timeit('z.get_set_bits_count_using_modulo_operator(25)'			,  setup=lowerCAmelCase__						)
          print(f'timeit() runs in {timing} seconds'						)
          print(f'{get_set_bits_count_using_brian_kernighans_algorithm(lowerCAmelCase__						) = }'						)
          _a      =							timeit(
              'z.get_set_bits_count_using_brian_kernighans_algorithm(25)'			,  setup=lowerCAmelCase__			,  )
          print(f'timeit() runs in {timing} seconds'						)

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


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 benchmark()

