

"""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				      =   logging.get_logger(__name__)

__lowerCAmelCase				      =   {
    '''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 	_lowerCAmelCase    (      __snake_case       ):
							__lowerCAmelCase					:    int     =  '''mobilevit'''

							def __init__( self       :    List[str] ,		a       :    Any=3 ,		a       :    str=256 ,		a       :    int=2 ,		a       :    Union[str, Any]=[144, 192, 240] ,		a       :    List[str]=[16, 32, 64, 96, 128, 160, 640] ,		a       :    Tuple=4 ,		a       :    Optional[Any]=2.0 ,		a       :    List[Any]=4.0 ,		a       :    List[str]="silu" ,		a       :    int=3 ,		a       :    List[Any]=32 ,		a       :    Optional[Any]=0.1 ,		a       :    Any=0.0 ,		a       :    List[str]=0.1 ,		a       :    Union[str, Any]=0.02 ,		a       :    List[Any]=1E-5 ,		a       :    int=True ,		a       :    List[Any]=256 ,		a       :    Union[str, Any]=[6, 12, 18] ,		a       :    Union[str, Any]=0.1 ,		a       :    Union[str, Any]=255 ,		**a       :    int ,		)   ->    str:

									"""simple docstring"""
									super().__init__(**a    )

									lowercase										=							num_channels
									lowercase										=							image_size
									lowercase										=							patch_size
									lowercase										=							hidden_sizes
									lowercase										=							neck_hidden_sizes
									lowercase										=							num_attention_heads
									lowercase										=							mlp_ratio
									lowercase										=							expand_ratio
									lowercase										=							hidden_act
									lowercase										=							conv_kernel_size
									lowercase										=							output_stride
									lowercase										=							hidden_dropout_prob
									lowercase										=							attention_probs_dropout_prob
									lowercase										=							classifier_dropout_prob
									lowercase										=							initializer_range
									lowercase										=							layer_norm_eps
									lowercase										=							qkv_bias

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




class 	_lowerCAmelCase    (      __snake_case       ):
							__lowerCAmelCase					:    Union[str, Any]     =  version.parse('''1.11'''       )

							@property
							def 					_lowerCAmelCase  ( self       :    str    )   ->    Mapping[str, Mapping[int, str]]:

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

							@property
							def 					_lowerCAmelCase  ( self       :    Optional[int]    )   ->    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 					_lowerCAmelCase  ( self       :    Dict    )   ->    float:

									"""simple docstring"""
									return 1E-4


"""simple docstring"""






from ..utils import DummyObject, requires_backends
class 	_lowerCAmelCase    (      metaclass=__snake_case       ):
							__lowerCAmelCase					:    Optional[Any]     =  ['''tensorflow_text''']

							def __init__( self       :    Optional[int] ,		*a       :    int ,		**a       :    str    )   ->    str:

									"""simple docstring"""
									requires_backends(self ,		['''tensorflow_text''']    )