




"""simple docstring"""



from collections import OrderedDict
from typing import Mapping

from packaging import version

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


A_    =							logging.get_logger(__name__)

A_    =							{
    '''microsoft/resnet-50''': '''https://huggingface.co/microsoft/resnet-50/blob/main/config.json''',
}






class 							__SCREAMING_SNAKE_CASE						(				__lowercase       ,		__lowercase		):
							snake_case_     =							'resnet'
							snake_case_     =							['basic', 'bottleneck']


							def __init__(			self      :						int			,    snake_case      :						int=3			,    snake_case      :						Optional[int]=64			,    snake_case      :						Optional[Any]=[256, 512, 1024, 2048]			,    snake_case      :						Union[str, Any]=[3, 4, 6, 3]			,    snake_case      :						int="bottleneck"			,    snake_case      :						str="relu"			,    snake_case      :						Dict=False			,    snake_case      :						List[str]=None			,    snake_case      :						str=None			,    **snake_case      :						Union[str, Any]			,    ):
													'''simple docstring'''





													super().__init__(**__A							)
													if layer_type not in self.layer_types:
																			raise ValueError(F'layer_type={layer_type} is not one of {",".join(self.layer_types							)}'							)
													A__						:  int		  =  num_channels
													A__						:  List[Any]		  =  embedding_size
													A__						:  int		  =  hidden_sizes
													A__						:  int		  =  depths
													A__						:  Union[str, Any]		  =  layer_type
													A__						:  Dict		  =  hidden_act
													A__						:  Optional[int]		  =  downsample_in_first_stage
													A__						:  int		  =  ["""stem"""] + [F'stage{idx}' for idx in range(1			,    len(__A							) + 1							)]
													A__  ,  A__						:  List[str]		  =  get_aligned_output_features_output_indices(
													    out_features=__A			,    out_indices=__A			,    stage_names=self.stage_names							)






class 							__SCREAMING_SNAKE_CASE						(				__lowercase		):
							snake_case_     =							version.parse('1.11'		)


							@property
							def 						_UpperCamelCase       (			self      :						str							):
													'''simple docstring'''





													return OrderedDict(
													    [
													        ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
													    ]							)


							@property
							def 						_UpperCamelCase       (			self      :						Union[str, Any]							):
													'''simple docstring'''





													return 1e-3














"""simple docstring"""



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


A_    =							{'''configuration_sew''': ['''SEW_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''SEWConfig''']}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						A_    =							[
						    '''SEW_PRETRAINED_MODEL_ARCHIVE_LIST''',
						    '''SEWForCTC''',
						    '''SEWForSequenceClassification''',
						    '''SEWModel''',
						    '''SEWPreTrainedModel''',
						]

if TYPE_CHECKING:
						from .configuration_sew import SEW_PRETRAINED_CONFIG_ARCHIVE_MAP, SEWConfig

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_sew import (
												    SEW_PRETRAINED_MODEL_ARCHIVE_LIST,
												    SEWForCTC,
												    SEWForSequenceClassification,
												    SEWModel,
												    SEWPreTrainedModel,
												)


else:
						import sys

						A_    =							_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)






