





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


_snake_case				= logging.get_logger(__name__)

_snake_case				= {
    """apple/mobilevitv2-1.0""": """https://huggingface.co/apple/mobilevitv2-1.0/resolve/main/config.json""",
}





class 					lowerCAmelCase							(   lowercase_					):
  __lowerCamelCase		=			'mobilevitv2'







  def __init__(			self  :str    ,							_lowercase  :Dict=3    ,							_lowercase  :Dict=2_56    ,							_lowercase  :Optional[int]=2    ,							_lowercase  :Union[str, Any]=2.0    ,							_lowercase  :List[Any]="swish"    ,							_lowercase  :Optional[Any]=3    ,							_lowercase  :Tuple=32    ,							_lowercase  :List[Any]=0.1    ,							_lowercase  :Dict=0.02    ,							_lowercase  :str=1e-5    ,							_lowercase  :Any=5_12    ,							_lowercase  :Optional[int]=[6, 12, 18]    ,							_lowercase  :Dict=0.1    ,							_lowercase  :Union[str, Any]=2_55    ,							_lowercase  :Dict=[2, 4, 3]    ,							_lowercase  :Optional[Any]=[1_28, 1_92, 2_56]    ,							_lowercase  :Optional[Any]=1.0    ,							_lowercase  :Any=2    ,							_lowercase  :Union[str, Any]=0.0    ,							_lowercase  :List[Any]=0.0    ,							**_lowercase  :Any    ,							):






     '''simple docstring'''





     super().__init__(**_lowercase					)

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

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





class 					lowerCAmelCase							(   lowercase_					):
  __lowerCamelCase		=			version.parse('1.11'					)







  @property
  def   UpperCAmelCase     (			self  :Optional[Any]					):






     '''simple docstring'''





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







  @property
  def   UpperCAmelCase     (			self  :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   UpperCAmelCase     (			self  :Dict					):






     '''simple docstring'''





     return 1e-4













from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_tokenizers_available


_snake_case				= {}

try:
  if not is_sentencepiece_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _snake_case				= ["""MBart50Tokenizer"""]

try:
  if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _snake_case				= ["""MBart50TokenizerFast"""]


if TYPE_CHECKING:
  try:
    if not is_sentencepiece_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_mbartaa import MBartaaTokenizer

  try:
    if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_mbartaa_fast import MBartaaTokenizerFast

else:
  import sys

  _snake_case				= _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)






