


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


__lowerCAmelCase	: Union[str, Any]  				=logging.get_logger(__name__)

__lowerCAmelCase	: Dict  				={
    'google/bit-50': 'https://huggingface.co/google/bit-50/resolve/main/config.json',
}
class        _lowercase      (			A__						,			A__       ):






				'''simple docstring'''



				SCREAMING_SNAKE_CASE__				:			List[str]						=		'''bit'''
				SCREAMING_SNAKE_CASE__				:			Tuple						=		['''preactivation''', '''bottleneck''']
				SCREAMING_SNAKE_CASE__				:			List[str]						=		['''SAME''', '''VALID''']


				def __init__(       self			:str			,			lowerCAmelCase__			:Any=3			,			lowerCAmelCase__			:Optional[Any]=64			,			lowerCAmelCase__			:str=[256, 512, 1_024, 2_048]			,			lowerCAmelCase__			:List[str]=[3, 4, 6, 3]			,			lowerCAmelCase__			:str="preactivation"			,			lowerCAmelCase__			:str="relu"			,			lowerCAmelCase__			:Dict=None			,			lowerCAmelCase__			:int=32			,			lowerCAmelCase__			:str=0.0			,			lowerCAmelCase__			:List[str]=False			,			lowerCAmelCase__			:Union[str, Any]=32			,			lowerCAmelCase__			:List[Any]=1			,			lowerCAmelCase__			:Optional[Any]=None			,			lowerCAmelCase__			:Optional[int]=None			,			**lowerCAmelCase__			:Union[str, Any]			,			)		->			Optional[Any]:
										super().__init__(**lowerCAmelCase__	)
										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:
																						__SCREAMING_SNAKE_CASE						:     Tuple					=		global_padding.upper()
																else:
																						raise ValueError(f'''Padding strategy {global_padding} not supported'''	)
										__SCREAMING_SNAKE_CASE						:     Optional[int]					=		num_channels
										__SCREAMING_SNAKE_CASE						:     str					=		embedding_size
										__SCREAMING_SNAKE_CASE						:     Union[str, Any]					=		hidden_sizes
										__SCREAMING_SNAKE_CASE						:     Union[str, Any]					=		depths
										__SCREAMING_SNAKE_CASE						:     Tuple					=		layer_type
										__SCREAMING_SNAKE_CASE						:     Optional[Any]					=		hidden_act
										__SCREAMING_SNAKE_CASE						:     Optional[int]					=		global_padding
										__SCREAMING_SNAKE_CASE						:     Optional[int]					=		num_groups
										__SCREAMING_SNAKE_CASE						:     List[Any]					=		drop_path_rate
										__SCREAMING_SNAKE_CASE						:     Tuple					=		embedding_dynamic_padding
										__SCREAMING_SNAKE_CASE						:     Union[str, Any]					=		output_stride
										__SCREAMING_SNAKE_CASE						:     List[str]					=		width_factor

										__SCREAMING_SNAKE_CASE						:     List[Any]					=		['''stem'''] + [f'''stage{idx}''' for idx in range(1			,			len(lowerCAmelCase__	) + 1	)]
										__SCREAMING_SNAKE_CASE			,			__SCREAMING_SNAKE_CASE						:     Dict					=		get_aligned_output_features_output_indices(
										    out_features=lowerCAmelCase__			,			out_indices=lowerCAmelCase__			,			stage_names=self.stage_names	)





"""simple docstring"""

from functools import lru_cache




@lru_cache
def __lowercase			(							_a    ):
    if num < 0:
        raise ValueError('''Number should not be negative.'''    )

    return 1 if num in (0, 1) else num * factorial(num - 1    )


if __name__ == "__main__":
     import doctest

     doctest.testmod()





