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


snake_case__				= logging.get_logger(__name__)

snake_case__				= {
    'google/bit-50': 'https://huggingface.co/google/bit-50/resolve/main/config.json',
}



class  UpperCamelCase				( __lowercase   ,  __lowercase ):

     '''simple docstring'''

     A_										=  'bit'
     A_										=  ['preactivation', 'bottleneck']
     A_										=  ['SAME', 'VALID']



     def __init__(					self				,				A_=3				,				A_=64				,				A_=[2_56, 5_12, 10_24, 20_48]				,				A_=[3, 4, 6, 3]				,				A_="preactivation"				,				A_="relu"				,				A_=None				,				A_=32				,				A_=0.0				,				A_=False				,				A_=32				,				A_=1				,				A_=None				,				A_=None				,				**A_				,				) ->				List[Any]:






           """simple docstring"""
           super().__init__(**A_						)
           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:
                       _lowerCamelCase			    =				global_padding.upper()
                 else:
                       raise ValueError(F'Padding strategy {global_padding} not supported'						)
           _lowerCamelCase			    =				num_channels
           _lowerCamelCase			    =				embedding_size
           _lowerCamelCase			    =				hidden_sizes
           _lowerCamelCase			    =				depths
           _lowerCamelCase			    =				layer_type
           _lowerCamelCase			    =				hidden_act
           _lowerCamelCase			    =				global_padding
           _lowerCamelCase			    =				num_groups
           _lowerCamelCase			    =				drop_path_rate
           _lowerCamelCase			    =				embedding_dynamic_padding
           _lowerCamelCase			    =				output_stride
           _lowerCamelCase			    =				width_factor

           _lowerCamelCase			    =				['''stem'''] + [F'stage{idx}' for idx in range(1				,				len(A_						) + 1						)]
           _lowerCamelCase    ,					_lowerCamelCase			    =				get_aligned_output_features_output_indices(
               out_features=A_				,				out_indices=A_				,				stage_names=self.stage_names						)
def       __magic_name__(  __UpperCAmelCase ,						__UpperCAmelCase		)						->    str:



      '''simple docstring'''

      _lowerCamelCase			    =				0
      while b > 0:
            if b & 1:
                  res += a

            a += a
            b >>= 1

      return res
def       __magic_name__(  __UpperCAmelCase ,						__UpperCAmelCase ,						__UpperCAmelCase		)						->    Optional[Any]:



      '''simple docstring'''

      _lowerCamelCase			    =				0
      while b > 0:
            if b & 1:
                  _lowerCamelCase			    =				((res % c) + (a % c)) % c

            a += a
            b >>= 1

      return res