

"""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


_lowercase   :	str												=						logging.get_logger(__name__)

_lowercase   :	Optional[int]												=						{
    'microsoft/resnet-50': 'https://huggingface.co/microsoft/resnet-50/blob/main/config.json',
}
class      _UpperCAmelCase   (							_lowerCAmelCase		,    _lowerCAmelCase       ):
	a__		: Optional[int]					=					"resnet"
	a__		: str					=					["basic", "bottleneck"]



	def __init__(  self     :       str			,    _lowercase     :       Dict=3			,    _lowercase     :       Optional[int]=64			,    _lowercase     :       Dict=[2_56, 5_12, 10_24, 20_48]			,    _lowercase     :       Optional[int]=[3, 4, 6, 3]			,    _lowercase     :       List[Any]="bottleneck"			,    _lowercase     :       List[str]="relu"			,    _lowercase     :       int=False			,    _lowercase     :       Dict=None			,    _lowercase     :       str=None			,    **_lowercase     :       Any			,    ):
		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						)}'''						)
		__UpperCAmelCase      		= num_channels
		__UpperCAmelCase      		= embedding_size
		__UpperCAmelCase      		= hidden_sizes
		__UpperCAmelCase      		= depths
		__UpperCAmelCase      		= layer_type
		__UpperCAmelCase      		= hidden_act
		__UpperCAmelCase      		= downsample_in_first_stage
		__UpperCAmelCase      		= ['''stem'''] + [F'''stage{idx}''' for idx in range(1			,    len(_lowercase						) + 1						)]
		__UpperCAmelCase		,							__UpperCAmelCase      		= get_aligned_output_features_output_indices(
		    out_features=_lowercase			,    out_indices=_lowercase			,    stage_names=self.stage_names						)






class      _UpperCAmelCase   (							_lowerCAmelCase       ):
	a__		: Tuple					=					version.parse("1.11"       )



	@property
	def        a  (  self     :       Optional[Any]						):
		return OrderedDict(
		    [
		        ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
		    ]						)



	@property
	def        a  (  self     :       int						):
		return 1E-3



from typing import TYPE_CHECKING

from ....utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


a_      =     {'configuration_van': ['VAN_PRETRAINED_CONFIG_ARCHIVE_MAP', 'VanConfig']}


try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			a_      =     [
			    'VAN_PRETRAINED_MODEL_ARCHIVE_LIST',
			    'VanForImageClassification',
			    'VanModel',
			    'VanPreTrainedModel',
			]

if TYPE_CHECKING:
			from .configuration_van import VAN_PRETRAINED_CONFIG_ARCHIVE_MAP, VanConfig

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_van import (
						    VAN_PRETRAINED_MODEL_ARCHIVE_LIST,
						    VanForImageClassification,
						    VanModel,
						    VanPreTrainedModel,
						)

else:
			import sys

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