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


lowercase  : List[Any]						   =							logging.get_logger(__name__)

lowercase  : Union[str, Any]						   =							{
    """google/bit-50""": """https://huggingface.co/google/bit-50/resolve/main/config.json""",
}

class __snake_case		(				lowerCAmelCase ,     lowerCAmelCase					):
    _a		:						Optional[Any]=    "bit"
    _a		:						Optional[Any]=    ["preactivation", "bottleneck"]
    _a		:						List[Any]=    ["SAME", "VALID"]
    def __init__(  self		,snake_case=3		,snake_case=64		,snake_case=[256, 512, 1024, 2048]		,snake_case=[3, 4, 6, 3]		,snake_case="preactivation"		,snake_case="relu"		,snake_case=None		,snake_case=32		,snake_case=0.0		,snake_case=False		,snake_case=32		,snake_case=1		,snake_case=None		,snake_case=None		,**snake_case		,):



           '''simple docstring'''







           super().__init__(**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:
                         lowercase							:					Tuple	     =				global_padding.upper()
                  else:
                         raise ValueError(f"Padding strategy {global_padding} not supported"				)
           lowercase							:					Union[str, Any]	     =				num_channels
           lowercase							:					Optional[Any]	     =				embedding_size
           lowercase							:					Optional[int]	     =				hidden_sizes
           lowercase							:					Union[str, Any]	     =				depths
           lowercase							:					List[str]	     =				layer_type
           lowercase							:					Optional[Any]	     =				hidden_act
           lowercase							:					List[Any]	     =				global_padding
           lowercase							:					Union[str, Any]	     =				num_groups
           lowercase							:					Dict	     =				drop_path_rate
           lowercase							:					Tuple	     =				embedding_dynamic_padding
           lowercase							:					Optional[int]	     =				output_stride
           lowercase							:					str	     =				width_factor

           lowercase							:					Optional[int]	     =				["""stem"""] + [f"stage{idx}" for idx in range(1		,len(snake_case				) + 1				)]
           lowercase     ,      lowercase							:					List[Any]	     =				get_aligned_output_features_output_indices(
               out_features=snake_case		,out_indices=snake_case		,stage_names=self.stage_names				)


def 						_snake_case(  SCREAMING_SNAKE_CASE__    )			->   int:
       assert (
           isinstance(SCREAMING_SNAKE_CASE__ ,     SCREAMING_SNAKE_CASE__    ) and number_of_steps > 0
       ), f"number_of_steps needs to be positive integer, your input {number_of_steps}"
       if number_of_steps == 1:
              return 1
       lowercase     ,      lowercase							:					Tuple	     =				1, 1
       for _ in range(number_of_steps - 1    ):
              lowercase     ,      lowercase							:					str	     =				current + previous, current
       return current


if __name__ == "__main__":
  import doctest

  doctest.testmod()
