


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			=						{
    'facebook/levit-128S': 'https://huggingface.co/facebook/levit-128S/resolve/main/config.json',
    # See all LeViT models at https://huggingface.co/models?filter=levit
}






class    UpperCAmelCase__	( A_		):



    """simple docstring"""






    UpperCAmelCase__						:		Any              =  "levit"






    def __init__(      self ,       A_=224 ,       A_=3 ,       A_=3 ,       A_=2 ,       A_=1 ,       A_=16 ,       A_=[128, 256, 384] ,       A_=[4, 8, 12] ,       A_=[4, 4, 4] ,       A_=[16, 16, 16] ,       A_=0 ,       A_=[2, 2, 2] ,       A_=[2, 2, 2] ,       A_=0.02 ,       **A_ ,       )  ->	Union[str, Any]:
         super().__init__(**A_   )
         __UpperCamelCase   							=image_size
         __UpperCamelCase   							=num_channels
         __UpperCamelCase   							=kernel_size
         __UpperCamelCase   							=stride
         __UpperCamelCase   							=padding
         __UpperCamelCase   							=hidden_sizes
         __UpperCamelCase   							=num_attention_heads
         __UpperCamelCase   							=depths
         __UpperCamelCase   							=key_dim
         __UpperCamelCase   							=drop_path_rate
         __UpperCamelCase   							=patch_size
         __UpperCamelCase   							=attention_ratio
         __UpperCamelCase   							=mlp_ratio
         __UpperCamelCase   							=initializer_range
         __UpperCamelCase   							=[
             ['Subsample', key_dim[0], hidden_sizes[0] // key_dim[0], 4, 2, 2],
             ['Subsample', key_dim[0], hidden_sizes[1] // key_dim[0], 4, 2, 2],
         ]






class    UpperCAmelCase__	( A_		):



    """simple docstring"""






    UpperCAmelCase__						:		int              =  version.parse("1.11"		)






    @property
    def _a (      self   )  ->	Mapping[str, Mapping[int, str]]:
         return OrderedDict(
             [
                 ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
             ]   )






    @property
    def _a (      self   )  ->	float:
         return 1E-4









from ..utils import DummyObject, requires_backends






class    UpperCAmelCase__	( metaclass=A_		):



    """simple docstring"""






    UpperCAmelCase__						:		Any              =  ["speech"]






    def __init__(      self ,       *A_ ,       **A_   )  ->	Any:
         requires_backends(self ,       ['speech']   )






class    UpperCAmelCase__	( metaclass=A_		):



    """simple docstring"""






    UpperCAmelCase__						:		Union[str, Any]              =  ["speech"]






    def __init__(      self ,       *A_ ,       **A_   )  ->	Union[str, Any]:
         requires_backends(self ,       ['speech']   )





