





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/mobilevitv2-1.0': 'https://huggingface.co/apple/mobilevitv2-1.0/resolve/main/config.json',
}



class 							_UpperCamelCase    (		lowerCAmelCase_   ):
       _UpperCamelCase :    Union[str, Any]   			=      '''mobilevitv2'''

       def __init__(						self:       Optional[Any]    ,      _SCREAMING_SNAKE_CASE:       List[str]=3    ,      _SCREAMING_SNAKE_CASE:       str=256    ,      _SCREAMING_SNAKE_CASE:       Union[str, Any]=2    ,      _SCREAMING_SNAKE_CASE:       Optional[int]=2.0    ,      _SCREAMING_SNAKE_CASE:       List[str]="swish"    ,      _SCREAMING_SNAKE_CASE:       Tuple=3    ,      _SCREAMING_SNAKE_CASE:       Optional[int]=32    ,      _SCREAMING_SNAKE_CASE:       Any=0.1    ,      _SCREAMING_SNAKE_CASE:       Optional[int]=0.02    ,      _SCREAMING_SNAKE_CASE:       List[str]=1e-5    ,      _SCREAMING_SNAKE_CASE:       str=512    ,      _SCREAMING_SNAKE_CASE:       int=[6, 12, 18]    ,      _SCREAMING_SNAKE_CASE:       int=0.1    ,      _SCREAMING_SNAKE_CASE:       Union[str, Any]=255    ,      _SCREAMING_SNAKE_CASE:       Dict=[2, 4, 3]    ,      _SCREAMING_SNAKE_CASE:       Optional[int]=[128, 192, 256]    ,      _SCREAMING_SNAKE_CASE:       str=1.0    ,      _SCREAMING_SNAKE_CASE:       str=2    ,      _SCREAMING_SNAKE_CASE:       int=0.0    ,      _SCREAMING_SNAKE_CASE:       Optional[Any]=0.0    ,      **_SCREAMING_SNAKE_CASE:       Optional[int]    ,      )				->       Optional[int]:




              """simple docstring"""


              super().__init__(**_SCREAMING_SNAKE_CASE						)

              UpperCamelCase_      				=     num_channels
              UpperCamelCase_      				=     image_size
              UpperCamelCase_      				=     patch_size
              UpperCamelCase_      				=     expand_ratio
              UpperCamelCase_      				=     hidden_act
              UpperCamelCase_      				=     conv_kernel_size
              UpperCamelCase_      				=     output_stride
              UpperCamelCase_      				=     initializer_range
              UpperCamelCase_      				=     layer_norm_eps
              UpperCamelCase_      				=     n_attn_blocks
              UpperCamelCase_      				=     base_attn_unit_dims
              UpperCamelCase_      				=     width_multiplier
              UpperCamelCase_      				=     ffn_multiplier
              UpperCamelCase_      				=     ffn_dropout
              UpperCamelCase_      				=     attn_dropout
              UpperCamelCase_      				=     classifier_dropout_prob

              # 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 :    Union[str, Any]   			=      version.parse('''1.11'''   )

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




              """simple docstring"""


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

       @property
       def lowercase       (						self:       Any						)				->       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:       Tuple						)				->       float:




              """simple docstring"""


              return 1e-4








import warnings

from .generation import GenerationMixin



class 							_UpperCamelCase    (		lowerCAmelCase_   ):
       # warning at import time
       warnings.warn(
           '''Importing `GenerationMixin` from `src/transformers/generation_utils.py` is deprecated and will '''
           '''be removed in Transformers v5. Import as `from transformers import GenerationMixin` instead.'''     ,  lowerCAmelCase_     ,  )

