






"""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__	:    str			 = logging.get_logger(__name__)

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







class        lowercase__      (							snake_case__,       snake_case__       ):
			_UpperCAmelCase		:Union[str, Any]             =			"resnet"
			_UpperCAmelCase		:Optional[int]             =			["basic", "bottleneck"]


			def __init__(				self					:  Union[str, Any]       ,	snake_case__					:  str=3       ,	snake_case__					:  Dict=64       ,	snake_case__					:  List[Any]=[256, 512, 1024, 2048]       ,	snake_case__					:  Tuple=[3, 4, 6, 3]       ,	snake_case__					:  List[str]="bottleneck"       ,	snake_case__					:  List[str]="relu"       ,	snake_case__					:  Any=False       ,	snake_case__					:  Optional[Any]=None       ,	snake_case__					:  List[Any]=None       ,	**snake_case__					:  Tuple       ,	):
										super().__init__(**snake_case__ )
										if layer_type not in self.layer_types:
																	raise ValueError(F"""layer_type={layer_type} is not one of {','.join(self.layer_types )}""" )
										lowerCamelCase_	:							Tuple									=num_channels
										lowerCamelCase_	:							List[Any]									=embedding_size
										lowerCamelCase_	:							List[Any]									=hidden_sizes
										lowerCamelCase_	:							List[str]									=depths
										lowerCamelCase_	:							Union[str, Any]									=layer_type
										lowerCamelCase_	:							Tuple									=hidden_act
										lowerCamelCase_	:							Union[str, Any]									=downsample_in_first_stage
										lowerCamelCase_	:							Any									=["stem"] + [F"""stage{idx}""" for idx in range(1       ,	len(snake_case__ ) + 1 )]
										lowerCamelCase_	:							Any									=get_aligned_output_features_output_indices(
										    out_features=snake_case__       ,	out_indices=snake_case__       ,	stage_names=self.stage_names )







class        lowercase__      (							snake_case__       ):
			_UpperCAmelCase		:Union[str, Any]             =			version.parse("1.11"       )


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


			@property
			def      UpperCAmelCase__						(				self					:  List[str] ):
										return 1E-3












"""simple docstring"""



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


A__	:    List[Any]			 = {
    'configuration_lilt': ['LILT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'LiltConfig'],
}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						A__	:    List[str]			 = [
						    'LILT_PRETRAINED_MODEL_ARCHIVE_LIST',
						    'LiltForQuestionAnswering',
						    'LiltForSequenceClassification',
						    'LiltForTokenClassification',
						    'LiltModel',
						    'LiltPreTrainedModel',
						]

if TYPE_CHECKING:
						from .configuration_lilt import LILT_PRETRAINED_CONFIG_ARCHIVE_MAP, LiltConfig

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_lilt import (
												    LILT_PRETRAINED_MODEL_ARCHIVE_LIST,
												    LiltForQuestionAnswering,
												    LiltForSequenceClassification,
												    LiltForTokenClassification,
												    LiltModel,
												    LiltPreTrainedModel,
												)

else:
						import sys

						A__	:    Optional[Any]			 = _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)



