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


snake_case  =			logging.get_logger(__name__)

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





class        SCREAMING_SNAKE_CASE   (				__a ):
  """simple docstring"""







  __A     =		"mobilevitv2"



  def __init__(  self   :					Dict					,					__lowerCAmelCase   :					Optional[Any]=3					,					__lowerCAmelCase   :					Optional[int]=256					,					__lowerCAmelCase   :					Dict=2					,					__lowerCAmelCase   :					int=2.0					,					__lowerCAmelCase   :					Tuple="swish"					,					__lowerCAmelCase   :					int=3					,					__lowerCAmelCase   :					Optional[Any]=32					,					__lowerCAmelCase   :					Optional[Any]=0.1					,					__lowerCAmelCase   :					Union[str, Any]=0.0_2					,					__lowerCAmelCase   :					List[Any]=1e-5					,					__lowerCAmelCase   :					int=512					,					__lowerCAmelCase   :					Optional[int]=[6, 12, 18]					,					__lowerCAmelCase   :					Union[str, Any]=0.1					,					__lowerCAmelCase   :					Any=255					,					__lowerCAmelCase   :					str=[2, 4, 3]					,					__lowerCAmelCase   :					Dict=[128, 192, 256]					,					__lowerCAmelCase   :					Optional[int]=1.0					,					__lowerCAmelCase   :					Tuple=2					,					__lowerCAmelCase   :					Union[str, Any]=0.0					,					__lowerCAmelCase   :					Optional[int]=0.0					,					**__lowerCAmelCase   :					Optional[int]					,					):


        """simple docstring"""



        super().__init__(**__lowerCAmelCase					)

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

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





class        SCREAMING_SNAKE_CASE   (				__a ):
  """simple docstring"""







  __A     =		version.parse("1.11" )



  @property
  def   a   (  self   :					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   :					List[str]					):


        """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        SCREAMING_SNAKE_CASE   (				unittest.TestCase	,						__a ):
  """simple docstring"""







  def   a   (  self   :					List[str]					):


        """simple docstring"""



        _lowerCAmelCase		   =   load_tool('speech-to-text'					)
        self.tool.setup()



  def   a   (  self   :					Any					):


        """simple docstring"""



        _lowerCAmelCase		   =   self.tool(torch.ones(3000					)					)
        self.assertEqual(__lowerCAmelCase					,					' you'					)



  def   a   (  self   :					Optional[int]					):


        """simple docstring"""



        _lowerCAmelCase		   =   self.tool(audio=torch.ones(3000					)					)
        self.assertEqual(__lowerCAmelCase					,					' you'					)





