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


_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 	__UpperCAmelCase						(__A    ):







			'''simple docstring'''
			_UpperCamelCase     :	str				    =							'mobilevit'





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







										'''simple docstring'''


										super().__init__(**snake_case_       )

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

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





class 	__UpperCAmelCase						(__A    ):







			'''simple docstring'''
			_UpperCamelCase     :	List[Any]				    =							version.parse('1.11'    )





			@property
			def 		lowerCamelCase				( self       ):







										'''simple docstring'''


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





			@property
			def 		lowerCamelCase				( self       ):







										'''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 		lowerCamelCase				( self       ):







										'''simple docstring'''


										return 1E-4






"""simple docstring"""



def    _A(		lowerCAmelCase       ):
							if not isinstance(lowerCAmelCase ,     lowerCAmelCase       ):
														A__					:    int														= F'''Input value of [number={number}] must be an integer'''
														raise TypeError(lowerCAmelCase       )
							if number < 0 or number % 2 == 1:
														return False
							A__					:    List[Any]														= int(number**0.5       )
							return number == number_sqrt * (number_sqrt + 1)


if __name__ == "__main__":
				import doctest

				doctest.testmod()





