



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_						=       logging.get_logger(__name__)

lowercase_						=       {
    """microsoft/resnet-50""": """https://huggingface.co/microsoft/resnet-50/blob/main/config.json""",
}
class 			_snake_case     (   lowercase__      ,		lowercase__):
				UpperCamelCase__			:   Tuple       						="""resnet"""
				UpperCamelCase__			:   str       						=["""basic""", """bottleneck"""]




				def __init__(  self   :  str,   __lowercase   :  Dict=3,   __lowercase   :  Optional[int]=64,   __lowercase   :  Tuple=[256, 512, 1024, 2048],   __lowercase   :  Optional[Any]=[3, 4, 6, 3],   __lowercase   :  Optional[Any]="bottleneck",   __lowercase   :  Optional[int]="relu",   __lowercase   :  Tuple=False,   __lowercase   :  Union[str, Any]=None,   __lowercase   :  Optional[int]=None,   **__lowercase   :  Optional[int],   ):
							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  )}'''  )
							lowercase__   					=			num_channels
							lowercase__   					=			embedding_size
							lowercase__   					=			hidden_sizes
							lowercase__   					=			depths
							lowercase__   					=			layer_type
							lowercase__   					=			hidden_act
							lowercase__   					=			downsample_in_first_stage
							lowercase__   					=			["stem"] + [F'''stage{idx}''' for idx in range(1,   len(__lowercase  ) + 1  )]
							lowercase__					,    lowercase__   					=			get_aligned_output_features_output_indices(
							    out_features=__lowercase,   out_indices=__lowercase,   stage_names=self.stage_names  )
class 			_snake_case     (   lowercase__):
				UpperCamelCase__			:   List[str]       						=version.parse("""1.11""")




				@property
				def 							A__ (  self   :  Tuple  ):
							return OrderedDict(
							    [
							        ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
							    ]  )




				@property
				def 							A__ (  self   :  Optional[Any]  ):
							return 1e-3









from __future__ import annotations



def __lowerCAmelCase	(       SCREAMING_SNAKE_CASE_					):
			return len(set(SCREAMING_SNAKE_CASE_					)					) == len(SCREAMING_SNAKE_CASE_					)


if __name__ == "__main__":
							import doctest

							doctest.testmod()




