




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

lowercase_     :    Optional[Any]      =			{
    '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    __lowerCAmelCase			(	_a			):
   snake_case_				:			List[str]								=					"""mobilevit"""







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




         """simple docstring"""


         super().__init__(**snake_case_				)

         _UpperCAmelCase													=					num_channels
         _UpperCAmelCase													=					image_size
         _UpperCAmelCase													=					patch_size
         _UpperCAmelCase													=					hidden_sizes
         _UpperCAmelCase													=					neck_hidden_sizes
         _UpperCAmelCase													=					num_attention_heads
         _UpperCAmelCase													=					mlp_ratio
         _UpperCAmelCase													=					expand_ratio
         _UpperCAmelCase													=					hidden_act
         _UpperCAmelCase													=					conv_kernel_size
         _UpperCAmelCase													=					output_stride
         _UpperCAmelCase													=					hidden_dropout_prob
         _UpperCAmelCase													=					attention_probs_dropout_prob
         _UpperCAmelCase													=					classifier_dropout_prob
         _UpperCAmelCase													=					initializer_range
         _UpperCAmelCase													=					layer_norm_eps
         _UpperCAmelCase													=					qkv_bias

         # decode head attributes for semantic segmentation
         _UpperCAmelCase													=					aspp_out_channels
         _UpperCAmelCase													=					atrous_rates
         _UpperCAmelCase													=					aspp_dropout_prob
         _UpperCAmelCase													=					semantic_loss_ignore_index






class    __lowerCAmelCase			(	_a			):
   snake_case_				:			Optional[int]								=					version.parse("1.11"			)







   @property
   def UpperCamelCase      (	self   :      str				):




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










from __future__ import annotations


def 							__SCREAMING_SNAKE_CASE  (      snake_case_						):

						'''simple docstring'''


						if len(snake_case_						) == 0:
												raise ValueError("find_max() arg is an empty sequence"						)
						_UpperCAmelCase													=					nums[0]
						for x in nums:
												if x > max_num:
																		_UpperCAmelCase													=					x
						return max_num


if __name__ == "__main__":
				import doctest

				doctest.testmod(verbose=True)




