


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					(       A_      , A_    ):
			lowercase						= '''bit'''
			lowercase						= ['''preactivation''', '''bottleneck''']
			lowercase						= ['''SAME''', '''VALID''']




			def __init__(						self							:		Dict       ,       __magic_name__							:		int=3       ,       __magic_name__							:		Union[str, Any]=6_4       ,       __magic_name__							:		List[str]=[2_5_6, 5_1_2, 1_0_2_4, 2_0_4_8]       ,       __magic_name__							:		Any=[3, 4, 6, 3]       ,       __magic_name__							:		Union[str, Any]="preactivation"       ,       __magic_name__							:		List[Any]="relu"       ,       __magic_name__							:		Optional[Any]=None       ,       __magic_name__							:		str=3_2       ,       __magic_name__							:		Dict=0.0       ,       __magic_name__							:		Any=False       ,       __magic_name__							:		int=3_2       ,       __magic_name__							:		Optional[Any]=1       ,       __magic_name__							:		str=None       ,       __magic_name__							:		Optional[Any]=None       ,       **__magic_name__							:		str       ,       ):







						"""simple docstring"""







						super().__init__(**__magic_name__						)
						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(__magic_name__						) + 1						)]
						UpperCamelCase         =					get_aligned_output_features_output_indices(
						    out_features=__magic_name__       ,       out_indices=__magic_name__       ,       stage_names=self.stage_names						)








def 							_lowercase    (		SCREAMING_SNAKE_CASE_   :		int	):





			"""simple docstring"""




			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
			UpperCamelCase  ,  UpperCamelCase         =					1, 1
			for _ in range(number_of_steps - 1	):
						UpperCamelCase  ,  UpperCamelCase         =					current + previous, current
			return current


if __name__ == "__main__":
			import doctest

			doctest.testmod()




