






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


__SCREAMING_SNAKE_CASE      =      logging.get_logger(__name__)

__SCREAMING_SNAKE_CASE      =      {
    """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 	__UpperCamelCase    (    UpperCamelCase__	):

					'''simple docstring'''





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

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

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




class 	__UpperCamelCase    (    UpperCamelCase__	):

					'''simple docstring'''





					lowercase_						:							Optional[int]			=     version.parse("""1.11"""	)
					@property
					def 					UpperCAmelCase__   (       self       :  Union[str, Any]      )  ->					Mapping[str, Mapping[int, str]]:
											return OrderedDict([('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'})]      )
					@property
					def 					UpperCAmelCase__   (       self       :  int      )  ->					Mapping[str, Mapping[int, str]]:




											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       :  Dict      )  ->					float:
											return 1e-4







"""simple docstring"""


import safs




class 	__UpperCamelCase    (    safs.SaFileSystem	):
					pass