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


lowercase		:    Union[str, Any]			=       logging.get_logger(__name__)

lowercase		:    int			=       {
    '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  _snake_case	(    _lowercase							):
							SCREAMING_SNAKE_CASE		  =    '''mobilevit'''






							def __init__(       self    :      Optional[Any]    ,			snake_case__    :      str=3    ,			snake_case__    :      Union[str, Any]=2_5_6    ,			snake_case__    :      str=2    ,			snake_case__    :      Any=[1_4_4, 1_9_2, 2_4_0]    ,			snake_case__    :      List[str]=[1_6, 3_2, 6_4, 9_6, 1_2_8, 1_6_0, 6_4_0]    ,			snake_case__    :      int=4    ,			snake_case__    :      Any=2.0    ,			snake_case__    :      Tuple=4.0    ,			snake_case__    :      List[Any]="silu"    ,			snake_case__    :      Dict=3    ,			snake_case__    :      int=3_2    ,			snake_case__    :      Tuple=0.1    ,			snake_case__    :      Optional[Any]=0.0    ,			snake_case__    :      Any=0.1    ,			snake_case__    :      Optional[Any]=0.02    ,			snake_case__    :      Tuple=1e-5    ,			snake_case__    :      Any=True    ,			snake_case__    :      Dict=2_5_6    ,			snake_case__    :      Optional[Any]=[6, 1_2, 1_8]    ,			snake_case__    :      Dict=0.1    ,			snake_case__    :      Optional[int]=2_5_5    ,			**snake_case__    :      List[str]    ,			):






												"""simple docstring"""



												super().__init__(**snake_case__     )

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

												# decode head attributes for semantic segmentation
												__a:    int		     =       aspp_out_channels
												__a:    List[Any]		     =       atrous_rates
												__a:    Optional[Any]		     =       aspp_dropout_prob
												__a:    List[str]		     =       semantic_loss_ignore_index






class  _snake_case	(    _lowercase							):
							SCREAMING_SNAKE_CASE		  =    version.parse('''1.11'''							)






							@property
							def 				__lowercase	(       self    :      Dict     ):






												"""simple docstring"""



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






							@property
							def 				__lowercase	(       self    :      Union[str, Any]     ):






												"""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 				__lowercase	(       self    :      List[str]     ):






												"""simple docstring"""



												return 1e-4


"""simple docstring"""
from typing import TYPE_CHECKING

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


lowercase		:    Dict			=       {
    'configuration_mobilenet_v1': [
        'MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'MobileNetV1Config',
        'MobileNetV1OnnxConfig',
    ],
}

try:
			if not is_vision_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			lowercase		:    Optional[int]			=       ['MobileNetV1FeatureExtractor']
			lowercase		:    Union[str, Any]			=       ['MobileNetV1ImageProcessor']

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			lowercase		:    Tuple			=       [
			    'MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST',
			    'MobileNetV1ForImageClassification',
			    'MobileNetV1Model',
			    'MobileNetV1PreTrainedModel',
			    'load_tf_weights_in_mobilenet_v1',
			]


if TYPE_CHECKING:
			from .configuration_mobilenet_va import (
			    MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP,
			    MobileNetVaConfig,
			    MobileNetVaOnnxConfig,
			)

			try:
						if not is_vision_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .feature_extraction_mobilenet_va import MobileNetVaFeatureExtractor
						from .image_processing_mobilenet_va import MobileNetVaImageProcessor

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_mobilenet_va import (
						    MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST,
						    MobileNetVaForImageClassification,
						    MobileNetVaModel,
						    MobileNetVaPreTrainedModel,
						    load_tf_weights_in_mobilenet_va,
						)


else:
			import sys

			lowercase		:    Union[str, Any]			=       _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)
