

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   __lowercase				(_UpperCAmelCase			):
 _UpperCamelCase        =  """mobilevitv2"""
 def __init__(							self				,							A_=3				,							A_=256				,							A_=2				,							A_=2.0				,							A_="swish"				,							A_=3				,							A_=32				,							A_=0.1				,							A_=0.02				,							A_=1e-5				,							A_=512				,							A_=[6, 12, 18]				,							A_=0.1				,							A_=255				,							A_=[2, 4, 3]				,							A_=[128, 192, 256]				,							A_=1.0				,							A_=2				,							A_=0.0				,							A_=0.0				,							**A_				,							) ->Any:



       '''simple docstring'''





       super().__init__(**A_ )

       __lowerCAmelCase :						List[Any] = num_channels
       __lowerCAmelCase :						Any = image_size
       __lowerCAmelCase :						int = patch_size
       __lowerCAmelCase :						List[Any] = expand_ratio
       __lowerCAmelCase :						Tuple = hidden_act
       __lowerCAmelCase :						Union[str, Any] = conv_kernel_size
       __lowerCAmelCase :						Optional[int] = output_stride
       __lowerCAmelCase :						Optional[int] = initializer_range
       __lowerCAmelCase :						Dict = layer_norm_eps
       __lowerCAmelCase :						int = n_attn_blocks
       __lowerCAmelCase :						int = base_attn_unit_dims
       __lowerCAmelCase :						str = width_multiplier
       __lowerCAmelCase :						Optional[int] = ffn_multiplier
       __lowerCAmelCase :						Dict = ffn_dropout
       __lowerCAmelCase :						List[Any] = attn_dropout
       __lowerCAmelCase :						int = classifier_dropout_prob

       # decode head attributes for semantic segmentation
       __lowerCAmelCase :						Any = aspp_out_channels
       __lowerCAmelCase :						Union[str, Any] = atrous_rates
       __lowerCAmelCase :						Any = aspp_dropout_prob
       __lowerCAmelCase :						Tuple = semantic_loss_ignore_index







class   __lowercase				(_UpperCAmelCase			):
 _UpperCamelCase        =  version.parse("""1.11"""			)
 @property
 def      UpperCamelCase__  (							self ) ->Mapping[str, Mapping[int, str]]:



       '''simple docstring'''





       return OrderedDict([('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''})] )
 @property
 def      UpperCamelCase__  (							self ) ->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      UpperCamelCase__  (							self ) ->float:



       '''simple docstring'''





       return 1e-4





def 		_lowercase			(					lowercase__						):
      return "".join(chr(ord(lowercase__						) + 3_2						) if '''A''' <= char <= '''Z''' else char for char in word						)


if __name__ == "__main__":
 from doctest import testmod

 testmod()


