code: 
  
  
  """simple docstring"""
  
  
  
  
  
  
  
  from typing import TYPE_CHECKING
  
  from ...utils import (
      OptionalDependencyNotAvailable,
      _LazyModule,
      is_tf_available,
      is_torch_available,
      is_vision_available,
  )
  
  
  lowerCamelCase_     :     List[Any]    		=						{
      """configuration_sam""": [
          """SAM_PRETRAINED_CONFIG_ARCHIVE_MAP""",
          """SamConfig""",
          """SamMaskDecoderConfig""",
          """SamPromptEncoderConfig""",
          """SamVisionConfig""",
      ],
      """processing_sam""": ["""SamProcessor"""],
  }
  
  
  try:
         if not is_torch_available():
                raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
         pass
  else:
         lowerCamelCase_     :     Tuple    		=						[
             """SAM_PRETRAINED_MODEL_ARCHIVE_LIST""",
             """SamModel""",
             """SamPreTrainedModel""",
         ]
  try:
         if not is_tf_available():
                raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
         pass
  else:
         lowerCamelCase_     :     Optional[Any]    		=						[
             """TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST""",
             """TFSamModel""",
             """TFSamPreTrainedModel""",
         ]
  try:
         if not is_vision_available():
                raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
         pass
  else:
         lowerCamelCase_     :     int    		=						["""SamImageProcessor"""]
  
  
  if TYPE_CHECKING:
         from .configuration_sam import (
             SAM_PRETRAINED_CONFIG_ARCHIVE_MAP,
             SamConfig,
             SamMaskDecoderConfig,
             SamPromptEncoderConfig,
             SamVisionConfig,
         )
         from .processing_sam import SamProcessor
  
         try:
                if not is_torch_available():
                       raise OptionalDependencyNotAvailable()
         except OptionalDependencyNotAvailable:
                pass
         else:
                from .modeling_sam import SAM_PRETRAINED_MODEL_ARCHIVE_LIST, SamModel, SamPreTrainedModel
  
         try:
                if not is_tf_available():
                       raise OptionalDependencyNotAvailable()
         except OptionalDependencyNotAvailable:
                pass
         else:
                from .modeling_tf_sam import TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST, TFSamModel, TFSamPreTrainedModel
  
         try:
                if not is_vision_available():
                       raise OptionalDependencyNotAvailable()
         except OptionalDependencyNotAvailable:
                pass
         else:
                from .image_processing_sam import SamImageProcessor
  
  else:
         import sys
  
         lowerCamelCase_     :     int    		=						_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)
  
  
  
  
  
  
style_context: 
  
  
  """simple docstring"""
  
  
  
  
  
  
  
  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_     :     Tuple    		=						{
      """apple/mobilevitv2-1.0""": """https://huggingface.co/apple/mobilevitv2-1.0/resolve/main/config.json""",
  }
  
  
  
  
  
  
  class    __A       ( _SCREAMING_SNAKE_CASE    ):
  
  
  
  
  
  
   """simple docstring"""
  
  
  
  
   __lowerCAmelCase				      =						"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				,					)      ->  int:
       super().__init__(**__A		)
  
       a					=num_channels
       a					=image_size
       a					=patch_size
       a					=expand_ratio
       a					=hidden_act
       a					=conv_kernel_size
       a					=output_stride
       a					=initializer_range
       a					=layer_norm_eps
       a					=n_attn_blocks
       a					=base_attn_unit_dims
       a					=width_multiplier
       a					=ffn_multiplier
       a					=ffn_dropout
       a					=attn_dropout
       a					=classifier_dropout_prob
  
       # decode head attributes for semantic segmentation
       a					=aspp_out_channels
       a					=atrous_rates
       a					=aspp_dropout_prob
       a					=semantic_loss_ignore_index
  
  
  
  
  
  
  class    __A       ( _SCREAMING_SNAKE_CASE    ):
  
  
  
  
  
  
   """simple docstring"""
  
  
  
  
   __lowerCAmelCase				      =						version.parse("1.11"    )
  
  
   @property
   def    SCREAMING_SNAKE_CASE							(	self		)      ->  Mapping[str, Mapping[int, str]]:
       return OrderedDict([('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''})]		)
  
  
   @property
   def    SCREAMING_SNAKE_CASE							(	self		)      ->  Mapping[str, Mapping[int, str]]:
       if self.task == "image-classification":
           return OrderedDict([('''logits''', {0: '''batch'''})]		)
       else:
           return OrderedDict([('''last_hidden_state''', {0: '''batch'''}), ('''pooler_output''', {0: '''batch'''})]		)
  
  
  
  
  
   @property
   def    SCREAMING_SNAKE_CASE							(	self		)      ->  float:
       return 1E-4