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


_lowerCAmelCase       =		logging.get_logger(__name__)

_lowerCAmelCase       =		{
    '''google/bit-50''': '''https://huggingface.co/google/bit-50/resolve/main/config.json''',
}
class     lowerCAmelCase_     (       __lowercase,  __lowercase ):
							UpperCAmelCase				   =     "bit"
							UpperCAmelCase				   =     ["preactivation", "bottleneck"]
							UpperCAmelCase				   =     ["SAME", "VALID"]







							def __init__(   self      :     Optional[int] ,			_A      :     Optional[Any]=3 ,			_A      :     Optional[int]=64 ,			_A      :     Optional[Any]=[256, 512, 1024, 2048] ,			_A      :     List[Any]=[3, 4, 6, 3] ,			_A      :     Tuple="preactivation" ,			_A      :     Union[str, Any]="relu" ,			_A      :     Dict=None ,			_A      :     List[Any]=32 ,			_A      :     Optional[Any]=0.0 ,			_A      :     Union[str, Any]=False ,			_A      :     Tuple=32 ,			_A      :     int=1 ,			_A      :     str=None ,			_A      :     Tuple=None ,			**_A      :     List[str] ,			):
												super().__init__(**UpperCamelCase_		)
												if layer_type not in self.layer_types:
																	raise ValueError(F"""layer_type={layer_type} is not one of {",".join(self.layer_types		)}"""		)
												if global_padding is not None:
																	if global_padding.upper() in self.supported_padding:
																						_UpperCamelCase			     =     global_padding.upper()
																	else:
																						raise ValueError(F"""Padding strategy {global_padding} not supported"""		)
												_UpperCamelCase			     =     num_channels
												_UpperCamelCase			     =     embedding_size
												_UpperCamelCase			     =     hidden_sizes
												_UpperCamelCase			     =     depths
												_UpperCamelCase			     =     layer_type
												_UpperCamelCase			     =     hidden_act
												_UpperCamelCase			     =     global_padding
												_UpperCamelCase			     =     num_groups
												_UpperCamelCase			     =     drop_path_rate
												_UpperCamelCase			     =     embedding_dynamic_padding
												_UpperCamelCase			     =     output_stride
												_UpperCamelCase			     =     width_factor

												_UpperCamelCase			     =     ['''stem'''] + [F"""stage{idx}""" for idx in range(1 ,			len(UpperCamelCase_		) + 1		)]
												_UpperCamelCase     ,    _UpperCamelCase			     =     get_aligned_output_features_output_indices(
												    out_features=UpperCamelCase_ ,			out_indices=UpperCamelCase_ ,			stage_names=self.stage_names		)







'''simple docstring'''




from math import loga




def 						__lowerCamelCase			(	UpperCAmelCase_							)   ->int:
	if a < 0:
		raise ValueError('Input value must be a positive integer'							)
	elif isinstance(UpperCAmelCase_					,				UpperCAmelCase_							):
		raise TypeError('Input value must be a \'int\' type'							)
	return 0 if (a == 0) else int(loga(a & -a							)							)


if __name__ == "__main__":
			import doctest

			doctest.testmod()



