



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


__UpperCAmelCase	       =	logging.get_logger(__name__)

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



class     lowerCAmelCase_		(  a__	,   a__							):
       UpperCAmelCase__    : Any       					=  "bit"
       UpperCAmelCase__    : Optional[Any]       					=  ["preactivation", "bottleneck"]
       UpperCAmelCase__    : Union[str, Any]       					=  ["SAME", "VALID"]
       def __init__(      self,      SCREAMING_SNAKE_CASE_=3,      SCREAMING_SNAKE_CASE_=64,      SCREAMING_SNAKE_CASE_=[256, 512, 1024, 2048],      SCREAMING_SNAKE_CASE_=[3, 4, 6, 3],      SCREAMING_SNAKE_CASE_="preactivation",      SCREAMING_SNAKE_CASE_="relu",      SCREAMING_SNAKE_CASE_=None,      SCREAMING_SNAKE_CASE_=32,      SCREAMING_SNAKE_CASE_=0.0,      SCREAMING_SNAKE_CASE_=False,      SCREAMING_SNAKE_CASE_=32,      SCREAMING_SNAKE_CASE_=1,      SCREAMING_SNAKE_CASE_=None,      SCREAMING_SNAKE_CASE_=None,      **SCREAMING_SNAKE_CASE_,      )					->		int:
          super().__init__(**SCREAMING_SNAKE_CASE_	)
          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   :  str						     =     global_padding.upper()
             else:
                raise ValueError(F"""Padding strategy {global_padding} not supported"""	)
          UpperCamelCase   :  Tuple						     =     num_channels
          UpperCamelCase   :  Union[str, Any]						     =     embedding_size
          UpperCamelCase   :  str						     =     hidden_sizes
          UpperCamelCase   :  Union[str, Any]						     =     depths
          UpperCamelCase   :  int						     =     layer_type
          UpperCamelCase   :  Any						     =     hidden_act
          UpperCamelCase   :  Union[str, Any]						     =     global_padding
          UpperCamelCase   :  List[str]						     =     num_groups
          UpperCamelCase   :  int						     =     drop_path_rate
          UpperCamelCase   :  Tuple						     =     embedding_dynamic_padding
          UpperCamelCase   :  Tuple						     =     output_stride
          UpperCamelCase   :  Any						     =     width_factor

          UpperCamelCase   :  Optional[Any]						     =     ['stem'] + [F"""stage{idx}""" for idx in range(1,      len(SCREAMING_SNAKE_CASE_	) + 1	)]
          UpperCamelCase   :  int						     =     get_aligned_output_features_output_indices(
              out_features=SCREAMING_SNAKE_CASE_,      out_indices=SCREAMING_SNAKE_CASE_,      stage_names=self.stage_names	)









from abc import ABC, abstractmethod
from argparse import ArgumentParser



class     lowerCAmelCase_		(  a__							):
       @staticmethod
       @abstractmethod
       def  snake_case_	(      SCREAMING_SNAKE_CASE_	)					->		int:
          raise NotImplementedError()






       @abstractmethod
       def  snake_case_	(      self	)					->		str:
          raise NotImplementedError()



