
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


A		:   Dict         =    logging.get_logger(__name__)

A		:   Tuple         =    {
    "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       a_   ( UpperCamelCase_						):
			a  : Dict             =       '''mobilevit'''






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

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

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







class       a_   ( UpperCamelCase_						):
			a  : List[Any]             =       version.parse('''1.11'''						)






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






			@property
			def       UpperCamelCase_							(			self     ):


									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     ):
									return 1E-4

from math import sqrt




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int					)     ->    list[int]:
						_lowercase									=				[1]
						for i in range(2		,      int(sqrt(SCREAMING_SNAKE_CASE_					)					) + 1		,      1					):
												if number % i == 0:
																		values.append(SCREAMING_SNAKE_CASE_					)
																		if int(number // i					) != i:
																								values.append(int(number // i					)					)
						return sorted(SCREAMING_SNAKE_CASE_					)




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int					)     ->    bool:
						return sum(factors(SCREAMING_SNAKE_CASE_					)					) > n




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int					)     ->    bool:
						_lowercase									=				factors(SCREAMING_SNAKE_CASE_					)
						_lowercase									=				len(SCREAMING_SNAKE_CASE_					)
						_lowercase									=				[[0 for i in range(number + 1					)] for j in range(r + 1					)]
						for i in range(r + 1					):
												_lowercase									=				True

						for i in range(1		,      number + 1					):
												_lowercase									=				False

						for i in range(1		,      r + 1					):
												for j in range(1		,      number + 1					):
																		if j < values[i - 1]:
																								_lowercase									=				subset[i - 1][j]
																		else:
																								_lowercase									=				subset[i - 1][j] or subset[i - 1][j - values[i - 1]]

						return subset[r][number] != 0




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int					)     ->    bool:
						return abundant(SCREAMING_SNAKE_CASE_					) and not semi_perfect(SCREAMING_SNAKE_CASE_					)


if __name__ == "__main__":
		import doctest

		doctest.testmod(verbose=True)
		for number in (69, 70, 71):
				print(F'{number} is {"" if weird(number) else "not "}weird.')