





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__  :	List[Any]     =logging.get_logger(__name__)

UpperCAmelCase__  :	Optional[Any]     ={
    '''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 					__A   (  a			):
				__A            = """mobilevit"""


				def __init__(						self      ,       UpperCAmelCase_=3      ,       UpperCAmelCase_=256      ,       UpperCAmelCase_=2      ,       UpperCAmelCase_=[144, 192, 240]      ,       UpperCAmelCase_=[16, 32, 64, 96, 128, 160, 640]      ,       UpperCAmelCase_=4      ,       UpperCAmelCase_=2.0      ,       UpperCAmelCase_=4.0      ,       UpperCAmelCase_="silu"      ,       UpperCAmelCase_=3      ,       UpperCAmelCase_=32      ,       UpperCAmelCase_=0.1      ,       UpperCAmelCase_=0.0      ,       UpperCAmelCase_=0.1      ,       UpperCAmelCase_=0.0_2      ,       UpperCAmelCase_=1E-5      ,       UpperCAmelCase_=True      ,       UpperCAmelCase_=256      ,       UpperCAmelCase_=[6, 12, 18]      ,       UpperCAmelCase_=0.1      ,       UpperCAmelCase_=255      ,       **UpperCAmelCase_      ,       ):
								super().__init__(**UpperCAmelCase_							)

								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 					__A   (  a			):
				__A            = version.parse("""1.11"""			)


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


				@property
				def _snake_case				(						self							):
								if self.task == "image-classification":
												return OrderedDict([("""logits""", {0: """batch"""})]							)
								else:
												return OrderedDict([("""last_hidden_state""", {0: """batch"""}), ("""pooler_output""", {0: """batch"""})]							)


				@property
				def _snake_case				(						self							):
								return 1E-4












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 					__A   (  a			):
				__A            = 42


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





