





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


_lowerCamelCase							=     logging.get_logger(__name__)

_lowerCamelCase							=     {
    '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__      ):
							lowerCamelCase_          =   "mobilevit"


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



									"""simple docstring"""



									super().__init__(**__A						)

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

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




class 					UpperCamelCase_    (       UpperCamelCase__      ):
							lowerCamelCase_          =   version.parse("1.11"      )


							@property
							def        _snake_case					(							self      :Optional[int]						)				->				Mapping[str, Mapping[int, str]]:



									"""simple docstring"""



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


							@property
							def        _snake_case					(							self      :List[str]						)				->				Mapping[str, Mapping[int, 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        _snake_case					(							self      :List[Any]						)				->				float:



									"""simple docstring"""



									return 1E-4






from ...configuration_utils import PretrainedConfig
from ...utils import logging


_lowerCamelCase							=     logging.get_logger(__name__)

_lowerCamelCase							=     {
    'MCG-NJU/videomae-base': 'https://huggingface.co/MCG-NJU/videomae-base/resolve/main/config.json',
}




class 					UpperCamelCase_    (       UpperCamelCase__      ):
							lowerCamelCase_          =   "videomae"


							def __init__(							self      :Dict							,			__A      :List[str]=224							,			__A      :List[Any]=16							,			__A      :int=3							,			__A      :Optional[Any]=16							,			__A      :Optional[int]=2							,			__A      :Optional[Any]=768							,			__A      :List[str]=12							,			__A      :Optional[Any]=12							,			__A      :List[str]=3072							,			__A      :Tuple="gelu"							,			__A      :Optional[int]=0.0							,			__A      :Union[str, Any]=0.0							,			__A      :int=0.0_2							,			__A      :Union[str, Any]=1E-12							,			__A      :Optional[Any]=True							,			__A      :Union[str, Any]=True							,			__A      :Optional[int]=6							,			__A      :Tuple=384							,			__A      :str=4							,			__A      :List[str]=1536							,			__A      :Dict=True							,			**__A      :int							,			)				->				Optional[int]:



									"""simple docstring"""



									super().__init__(**__A						)

									SCREAMING_SNAKE_CASE__								= image_size
									SCREAMING_SNAKE_CASE__								= patch_size
									SCREAMING_SNAKE_CASE__								= num_channels
									SCREAMING_SNAKE_CASE__								= num_frames
									SCREAMING_SNAKE_CASE__								= tubelet_size

									SCREAMING_SNAKE_CASE__								= hidden_size
									SCREAMING_SNAKE_CASE__								= num_hidden_layers
									SCREAMING_SNAKE_CASE__								= num_attention_heads
									SCREAMING_SNAKE_CASE__								= intermediate_size
									SCREAMING_SNAKE_CASE__								= hidden_act
									SCREAMING_SNAKE_CASE__								= hidden_dropout_prob
									SCREAMING_SNAKE_CASE__								= attention_probs_dropout_prob
									SCREAMING_SNAKE_CASE__								= initializer_range
									SCREAMING_SNAKE_CASE__								= layer_norm_eps
									SCREAMING_SNAKE_CASE__								= qkv_bias
									SCREAMING_SNAKE_CASE__								= use_mean_pooling

									SCREAMING_SNAKE_CASE__								= decoder_num_attention_heads
									SCREAMING_SNAKE_CASE__								= decoder_hidden_size
									SCREAMING_SNAKE_CASE__								= decoder_num_hidden_layers
									SCREAMING_SNAKE_CASE__								= decoder_intermediate_size
									SCREAMING_SNAKE_CASE__								= norm_pix_loss