





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       (						lowerCAmelCase_  ):
       _UpperCamelCase					:       Dict       = '''mobilevit'''

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




              """simple docstring"""


              super().__init__(**_SCREAMING_SNAKE_CASE		)

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

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



class 				_UpperCamelCase       (						lowerCAmelCase_  ):
       _UpperCamelCase					:       Dict       = version.parse('''1.11'''  )

       @property
       def lowercase			(		self:			List[str]		)							->			Mapping[str, Mapping[int, str]]:




              """simple docstring"""


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

       @property
       def lowercase			(		self:			Optional[int]		)							->			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 lowercase			(		self:			Union[str, Any]		)							->			float:




              """simple docstring"""


              return 1e-4








import warnings

from ...utils import logging
from .image_processing_convnext import ConvNextImageProcessor


_UpperCAmelCase										=					logging.get_logger(__name__)



class 				_UpperCamelCase       (						lowerCAmelCase_  ):

       def __init__(		self:			Tuple       , *_SCREAMING_SNAKE_CASE:			List[Any]       , **_SCREAMING_SNAKE_CASE:			List[Any]		)							->			None:




              """simple docstring"""


              warnings.warn(
                  "The class ConvNextFeatureExtractor is deprecated and will be removed in version 5 of Transformers."
                  " Please use ConvNextImageProcessor instead."       , _SCREAMING_SNAKE_CASE       , )
              super().__init__(*_SCREAMING_SNAKE_CASE       , **_SCREAMING_SNAKE_CASE		)

