




'''simple docstring'''

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


a  :				Any									=  logging.get_logger(__name__)

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






class 						a				(   _lowerCamelCase   ,     _lowerCamelCase     ):
				snake_case_      =		"bit"
				snake_case_      =		["preactivation", "bottleneck"]
				snake_case_      =		["SAME", "VALID"]


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

									snake_case_									=				['''stem'''] + [F"stage{idx}" for idx in range(1       ,				len(lowercase_					) + 1					)]
									snake_case_			,snake_case_									=				get_aligned_output_features_output_indices(
									    out_features=lowercase_       ,				out_indices=lowercase_       ,				stage_names=self.stage_names					)


'''simple docstring'''




from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_torch_available,
)


__lowercase          =  {
    '''configuration_resnet''': ['''RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''ResNetConfig''', '''ResNetOnnxConfig''']
}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__lowercase          =  [
						    '''RESNET_PRETRAINED_MODEL_ARCHIVE_LIST''',
						    '''ResNetForImageClassification''',
						    '''ResNetModel''',
						    '''ResNetPreTrainedModel''',
						    '''ResNetBackbone''',
						]

try:
						if not is_tf_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__lowercase          =  [
						    '''TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST''',
						    '''TFResNetForImageClassification''',
						    '''TFResNetModel''',
						    '''TFResNetPreTrainedModel''',
						]

try:
						if not is_flax_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__lowercase          =  [
						    '''FlaxResNetForImageClassification''',
						    '''FlaxResNetModel''',
						    '''FlaxResNetPreTrainedModel''',
						]

if TYPE_CHECKING:
						from .configuration_resnet import RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP, ResNetConfig, ResNetOnnxConfig

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_resnet import (
												    RESNET_PRETRAINED_MODEL_ARCHIVE_LIST,
												    ResNetBackbone,
												    ResNetForImageClassification,
												    ResNetModel,
												    ResNetPreTrainedModel,
												)

						try:
												if not is_tf_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_tf_resnet import (
												    TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST,
												    TFResNetForImageClassification,
												    TFResNetModel,
												    TFResNetPreTrainedModel,
												)

						try:
												if not is_flax_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_flax_resnet import FlaxResNetForImageClassification, FlaxResNetModel, FlaxResNetPreTrainedModel


else:
						import sys

						__lowercase          =  _LazyModule(__name__, globals()['''__file__'''], _import_structure)




