
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


UpperCamelCase_  =	logging.get_logger(__name__)

UpperCamelCase_  =	{
    "apple/mobilevit-small": "https://huggingface.co/apple/mobilevit-small/resolve/main/config.json",
    "apple/mobilevit-x-small": "https://huggingface.co/apple/mobilevit-x-small/resolve/main/config.json",
    "apple/mobilevit-xx-small": "https://huggingface.co/apple/mobilevit-xx-small/resolve/main/config.json",
    "apple/deeplabv3-mobilevit-small": (
        "https://huggingface.co/apple/deeplabv3-mobilevit-small/resolve/main/config.json"
    ),
    "apple/deeplabv3-mobilevit-x-small": (
        "https://huggingface.co/apple/deeplabv3-mobilevit-x-small/resolve/main/config.json"
    ),
    "apple/deeplabv3-mobilevit-xx-small": (
        "https://huggingface.co/apple/deeplabv3-mobilevit-xx-small/resolve/main/config.json"
    ),
    # See all MobileViT models at https://huggingface.co/models?filter=mobilevit
}

class     _SCREAMING_SNAKE_CASE							(		snake_case							):
				lowerCamelCase_       =     'mobilevit'





				def __init__(		self :		Tuple					,      snake_case_ :		Union[str, Any]=3					,      snake_case_ :		Dict=256					,      snake_case_ :		Optional[int]=2					,      snake_case_ :		Optional[int]=[144, 192, 240]					,      snake_case_ :		Optional[Any]=[16, 32, 64, 96, 128, 160, 640]					,      snake_case_ :		Union[str, Any]=4					,      snake_case_ :		List[Any]=2.0					,      snake_case_ :		Optional[Any]=4.0					,      snake_case_ :		Optional[Any]="silu"					,      snake_case_ :		Any=3					,      snake_case_ :		Dict=32					,      snake_case_ :		Dict=0.1					,      snake_case_ :		Optional[Any]=0.0					,      snake_case_ :		Any=0.1					,      snake_case_ :		Tuple=0.02					,      snake_case_ :		Dict=1E-5					,      snake_case_ :		List[str]=True					,      snake_case_ :		List[str]=256					,      snake_case_ :		Union[str, Any]=[6, 12, 18]					,      snake_case_ :		Tuple=0.1					,      snake_case_ :		Any=255					,      **snake_case_ :		Dict					,      ):


								"""simple docstring"""

								super().__init__(**snake_case_							)

								A     :  Optional[Any]   =				num_channels
								A     :  List[Any]   =				image_size
								A     :  Optional[int]   =				patch_size
								A     :  List[Any]   =				hidden_sizes
								A     :  int   =				neck_hidden_sizes
								A     :  List[str]   =				num_attention_heads
								A     :  Tuple   =				mlp_ratio
								A     :  List[str]   =				expand_ratio
								A     :  Optional[Any]   =				hidden_act
								A     :  Union[str, Any]   =				conv_kernel_size
								A     :  List[Any]   =				output_stride
								A     :  Any   =				hidden_dropout_prob
								A     :  Optional[Any]   =				attention_probs_dropout_prob
								A     :  Optional[Any]   =				classifier_dropout_prob
								A     :  List[str]   =				initializer_range
								A     :  List[str]   =				layer_norm_eps
								A     :  Union[str, Any]   =				qkv_bias

								# decode head attributes for semantic segmentation
								A     :  Dict   =				aspp_out_channels
								A     :  Any   =				atrous_rates
								A     :  int   =				aspp_dropout_prob
								A     :  Optional[int]   =				semantic_loss_ignore_index



class     _SCREAMING_SNAKE_CASE							(		snake_case							):
				lowerCamelCase_       =     version.parse('1.11'							)





				@property
				def        _UpperCAmelCase						(		self :		List[Any]							):


								"""simple docstring"""

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





				@property
				def        _UpperCAmelCase						(		self :		List[str]							):


								"""simple docstring"""

								if self.task == "image-classification":
												return OrderedDict([('''logits''', {0: '''batch'''})]							)
								else:
												return OrderedDict([('''last_hidden_state''', {0: '''batch'''}), ('''pooler_output''', {0: '''batch'''})]							)






				@property
				def        _UpperCAmelCase						(		self :		List[str]							):


								"""simple docstring"""

								return 1E-4

def 							_lowerCamelCase			(					lowerCamelCase_:  int		):



				'''simple docstring'''







				if not isinstance(lowerCamelCase_				,	lowerCamelCase_		):
								raise ValueError('''double_factorial() only accepts integral values'''		)
				if num < 0:
								raise ValueError('''double_factorial() not defined for negative values'''		)
				A     :  int   =				1
				for i in range(lowerCamelCase_				,	0				,	-2		):
								value *= i
				return value


if __name__ == "__main__":
					import doctest

					doctest.testmod()