




'''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


A			   =logging.get_logger(__name__)

A			   ={
    'apple/mobilevitv2-1.0': 'https://huggingface.co/apple/mobilevitv2-1.0/resolve/main/config.json',
}


class       _a  (     __a			):
       __a    :					Union[str, Any]           = """mobilevitv2"""
       def __init__(     self						:     Any       ,    lowercase						:     str=3       ,    lowercase						:     List[Any]=256       ,    lowercase						:     Tuple=2       ,    lowercase						:     List[Any]=2.0       ,    lowercase						:     Optional[Any]="swish"       ,    lowercase						:     List[Any]=3       ,    lowercase						:     List[Any]=32       ,    lowercase						:     int=0.1       ,    lowercase						:     List[Any]=0.02       ,    lowercase						:     Tuple=1E-5       ,    lowercase						:     int=512       ,    lowercase						:     Any=[6, 12, 18]       ,    lowercase						:     Any=0.1       ,    lowercase						:     List[str]=255       ,    lowercase						:     List[Any]=[2, 4, 3]       ,    lowercase						:     Union[str, Any]=[128, 192, 256]       ,    lowercase						:     Optional[int]=1.0       ,    lowercase						:     Any=2       ,    lowercase						:     int=0.0       ,    lowercase						:     List[Any]=0.0       ,    **lowercase						:     List[str]       ,    ):



           '''simple docstring'''

           super().__init__(**lowercase    )

           UpperCAmelCase      	=		num_channels
           UpperCAmelCase      	=		image_size
           UpperCAmelCase      	=		patch_size
           UpperCAmelCase      	=		expand_ratio
           UpperCAmelCase      	=		hidden_act
           UpperCAmelCase      	=		conv_kernel_size
           UpperCAmelCase      	=		output_stride
           UpperCAmelCase      	=		initializer_range
           UpperCAmelCase      	=		layer_norm_eps
           UpperCAmelCase      	=		n_attn_blocks
           UpperCAmelCase      	=		base_attn_unit_dims
           UpperCAmelCase      	=		width_multiplier
           UpperCAmelCase      	=		ffn_multiplier
           UpperCAmelCase      	=		ffn_dropout
           UpperCAmelCase      	=		attn_dropout
           UpperCAmelCase      	=		classifier_dropout_prob

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






class       _a  (     __a			):
       __a    :					Union[str, Any]           = version.parse("""1.11"""			)
       @property
       def    A				(     self						:     Optional[Any]    ):



           '''simple docstring'''

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



           '''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    A				(     self						:     Optional[int]    ):



           '''simple docstring'''

           return 1E-4










'''simple docstring'''







import unittest

from transformers import is_torch_available, load_tool

from .test_tools_common import ToolTesterMixin


if is_torch_available():
   import torch


class       _a  (     unittest.TestCase							,							__a			):
       def    A				(     self						:     str    ):



           '''simple docstring'''

           UpperCAmelCase      	=		load_tool('''speech-to-text'''    )
           self.tool.setup()
       def    A				(     self						:     Dict    ):



           '''simple docstring'''

           UpperCAmelCase      	=		self.tool(torch.ones(3_000    )    )
           self.assertEqual(lowercase       ,    ''' you'''    )







       def    A				(     self						:     Dict    ):



           '''simple docstring'''

           UpperCAmelCase      	=		self.tool(audio=torch.ones(3_000    )    )
           self.assertEqual(lowercase       ,    ''' you'''    )




