

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

_lowerCAmelCase  :      Optional[int]			 ={
    """facebook/levit-128S""": """https://huggingface.co/facebook/levit-128S/resolve/main/config.json""",
    # See all LeViT models at https://huggingface.co/models?filter=levit
}

class __UpperCamelCase     (				_a		):






					'''simple docstring'''



					__magic_name__        =   "levit"





					def __init__(				self				,      lowerCamelCase__=2_2_4				,      lowerCamelCase__=3				,      lowerCamelCase__=3				,      lowerCamelCase__=2				,      lowerCamelCase__=1				,      lowerCamelCase__=1_6				,      lowerCamelCase__=[1_2_8, 2_5_6, 3_8_4]				,      lowerCamelCase__=[4, 8, 1_2]				,      lowerCamelCase__=[4, 4, 4]				,      lowerCamelCase__=[1_6, 1_6, 1_6]				,      lowerCamelCase__=0				,      lowerCamelCase__=[2, 2, 2]				,      lowerCamelCase__=[2, 2, 2]				,      lowerCamelCase__=0.02				,      **lowerCamelCase__				,      ):
						super().__init__(**lowerCamelCase__						)
						UpperCAmelCase__:	int									= image_size
						UpperCAmelCase__:	Optional[int]									= num_channels
						UpperCAmelCase__:	Tuple									= kernel_size
						UpperCAmelCase__:	Optional[Any]									= stride
						UpperCAmelCase__:	Dict									= padding
						UpperCAmelCase__:	Optional[Any]									= hidden_sizes
						UpperCAmelCase__:	str									= num_attention_heads
						UpperCAmelCase__:	Union[str, Any]									= depths
						UpperCAmelCase__:	Any									= key_dim
						UpperCAmelCase__:	Optional[Any]									= drop_path_rate
						UpperCAmelCase__:	List[Any]									= patch_size
						UpperCAmelCase__:	int									= attention_ratio
						UpperCAmelCase__:	int									= mlp_ratio
						UpperCAmelCase__:	str									= initializer_range
						UpperCAmelCase__:	Union[str, Any]									= [
						    ["Subsample", key_dim[0], hidden_sizes[0] // key_dim[0], 4, 2, 2],
						    ["Subsample", key_dim[0], hidden_sizes[1] // key_dim[0], 4, 2, 2],
						]

class __UpperCamelCase     (				_a		):






					'''simple docstring'''



					__magic_name__        =   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						):
						return 1e-4


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


_lowerCAmelCase  :      Tuple			 ={
    """configuration_mobilenet_v2""": [
        """MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """MobileNetV2Config""",
        """MobileNetV2OnnxConfig""",
    ],
}

try:
					if not is_vision_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					_lowerCAmelCase  :      Tuple			 =["""MobileNetV2FeatureExtractor"""]
					_lowerCAmelCase  :      Optional[int]			 =["""MobileNetV2ImageProcessor"""]


try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					_lowerCAmelCase  :      List[str]			 =[
					    """MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST""",
					    """MobileNetV2ForImageClassification""",
					    """MobileNetV2ForSemanticSegmentation""",
					    """MobileNetV2Model""",
					    """MobileNetV2PreTrainedModel""",
					    """load_tf_weights_in_mobilenet_v2""",
					]


if TYPE_CHECKING:
					from .configuration_mobilenet_va import (
					    MOBILENET_V2_PRETRAINED_CONFIG_ARCHIVE_MAP,
					    MobileNetVaConfig,
					    MobileNetVaOnnxConfig,
					)

					try:
										if not is_vision_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .feature_extraction_mobilenet_va import MobileNetVaFeatureExtractor
										from .image_processing_mobilenet_va import MobileNetVaImageProcessor

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_mobilenet_va import (
										    MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST,
										    MobileNetVaForImageClassification,
										    MobileNetVaForSemanticSegmentation,
										    MobileNetVaModel,
										    MobileNetVaPreTrainedModel,
										    load_tf_weights_in_mobilenet_va,
										)


else:
					import sys

					_lowerCAmelCase  :      Any			 =_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)