code: 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
  
  
  lowercase__    :       List[str]						=			logging.get_logger(__name__)
  
  lowercase__    :       Dict						=			{
      '''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      lowercase_						(						UpperCamelCase_		):
  	UpperCAmelCase_						:      str     =       """mobilevit"""
  
  
  	def __init__(							self	,    __SCREAMING_SNAKE_CASE=3	,    __SCREAMING_SNAKE_CASE=256	,    __SCREAMING_SNAKE_CASE=2	,    __SCREAMING_SNAKE_CASE=[144, 192, 240]	,    __SCREAMING_SNAKE_CASE=[16, 32, 64, 96, 128, 160, 640]	,    __SCREAMING_SNAKE_CASE=4	,    __SCREAMING_SNAKE_CASE=2.0	,    __SCREAMING_SNAKE_CASE=4.0	,    __SCREAMING_SNAKE_CASE="silu"	,    __SCREAMING_SNAKE_CASE=3	,    __SCREAMING_SNAKE_CASE=32	,    __SCREAMING_SNAKE_CASE=0.1	,    __SCREAMING_SNAKE_CASE=0.0	,    __SCREAMING_SNAKE_CASE=0.1	,    __SCREAMING_SNAKE_CASE=0.0_2	,    __SCREAMING_SNAKE_CASE=1e-5	,    __SCREAMING_SNAKE_CASE=True	,    __SCREAMING_SNAKE_CASE=256	,    __SCREAMING_SNAKE_CASE=[6, 12, 18]	,    __SCREAMING_SNAKE_CASE=0.1	,    __SCREAMING_SNAKE_CASE=255	,    **__SCREAMING_SNAKE_CASE	,    )		->Tuple:
  								super().__init__(**__SCREAMING_SNAKE_CASE       )
  
  								lowerCAmelCase				=	num_channels
  								lowerCAmelCase				=	image_size
  								lowerCAmelCase				=	patch_size
  								lowerCAmelCase				=	hidden_sizes
  								lowerCAmelCase				=	neck_hidden_sizes
  								lowerCAmelCase				=	num_attention_heads
  								lowerCAmelCase				=	mlp_ratio
  								lowerCAmelCase				=	expand_ratio
  								lowerCAmelCase				=	hidden_act
  								lowerCAmelCase				=	conv_kernel_size
  								lowerCAmelCase				=	output_stride
  								lowerCAmelCase				=	hidden_dropout_prob
  								lowerCAmelCase				=	attention_probs_dropout_prob
  								lowerCAmelCase				=	classifier_dropout_prob
  								lowerCAmelCase				=	initializer_range
  								lowerCAmelCase				=	layer_norm_eps
  								lowerCAmelCase				=	qkv_bias
  
  								# decode head attributes for semantic segmentation
  								lowerCAmelCase				=	aspp_out_channels
  								lowerCAmelCase				=	atrous_rates
  								lowerCAmelCase				=	aspp_dropout_prob
  								lowerCAmelCase				=	semantic_loss_ignore_index
  
  
  
  
  class      lowercase_						(						UpperCamelCase_		):
  	UpperCAmelCase_						:      Tuple     =       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
  
  
  
  
style_context: from dataclasses import dataclass
  from typing import List, Optional, Union
  
  import numpy as np
  import PIL
  
  from ...utils import BaseOutput, is_invisible_watermark_available, is_torch_available, is_transformers_available
  
  
  
  
  @dataclass
  class      lowercase_						(						UpperCamelCase_		):
  
  
  
  	"""simple docstring"""
  
  
  
  
  
  	UpperCAmelCase_						:      Union[List[PIL.Image.Image], np.ndarray]
  
  
  if is_transformers_available() and is_torch_available() and is_invisible_watermark_available():
  	from .pipeline_stable_diffusion_xl import StableDiffusionXLPipeline
  	from .pipeline_stable_diffusion_xl_imgaimg import StableDiffusionXLImgaImgPipeline
  
  
  
  