



"""simple docstring"""
from ..utils import DummyObject, requires_backends






class  _SCREAMING_SNAKE_CASE(       metaclass=A  ):
       SCREAMING_SNAKE_CASE_       :				List[str]     						=  ['''torch''', '''scipy''']




       def __init__(						self		,*SCREAMING_SNAKE_CASE__		,**SCREAMING_SNAKE_CASE__							)      ->				int:





             """simple docstring"""






             requires_backends(self		,['''torch''', '''scipy''']							)




       @classmethod
       def    _UpperCamelCase					(						cls		,*SCREAMING_SNAKE_CASE__		,**SCREAMING_SNAKE_CASE__							)      ->				Any:





             """simple docstring"""






             requires_backends(cls		,['''torch''', '''scipy''']							)




       @classmethod
       def    _UpperCamelCase					(						cls		,*SCREAMING_SNAKE_CASE__		,**SCREAMING_SNAKE_CASE__							)      ->				List[Any]:





             """simple docstring"""






             requires_backends(cls		,['''torch''', '''scipy''']							)






"""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_       =		{
    "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  _SCREAMING_SNAKE_CASE(       A  ):
       SCREAMING_SNAKE_CASE_       :				List[Any]     						=  '''levit'''




       def __init__(						self		,SCREAMING_SNAKE_CASE__=2_24		,SCREAMING_SNAKE_CASE__=3		,SCREAMING_SNAKE_CASE__=3		,SCREAMING_SNAKE_CASE__=2		,SCREAMING_SNAKE_CASE__=1		,SCREAMING_SNAKE_CASE__=16		,SCREAMING_SNAKE_CASE__=[1_28, 2_56, 3_84]		,SCREAMING_SNAKE_CASE__=[4, 8, 12]		,SCREAMING_SNAKE_CASE__=[4, 4, 4]		,SCREAMING_SNAKE_CASE__=[16, 16, 16]		,SCREAMING_SNAKE_CASE__=0		,SCREAMING_SNAKE_CASE__=[2, 2, 2]		,SCREAMING_SNAKE_CASE__=[2, 2, 2]		,SCREAMING_SNAKE_CASE__=0.0_2		,**SCREAMING_SNAKE_CASE__		,)      ->				Tuple:





             """simple docstring"""






             super().__init__(**SCREAMING_SNAKE_CASE__							)
             __SCREAMING_SNAKE_CASE       :Dict		    =  image_size
             __SCREAMING_SNAKE_CASE       :Dict		    =  num_channels
             __SCREAMING_SNAKE_CASE       :Optional[int]		    =  kernel_size
             __SCREAMING_SNAKE_CASE       :Union[str, Any]		    =  stride
             __SCREAMING_SNAKE_CASE       :List[Any]		    =  padding
             __SCREAMING_SNAKE_CASE       :Tuple		    =  hidden_sizes
             __SCREAMING_SNAKE_CASE       :List[str]		    =  num_attention_heads
             __SCREAMING_SNAKE_CASE       :Optional[int]		    =  depths
             __SCREAMING_SNAKE_CASE       :Optional[Any]		    =  key_dim
             __SCREAMING_SNAKE_CASE       :Optional[Any]		    =  drop_path_rate
             __SCREAMING_SNAKE_CASE       :Tuple		    =  patch_size
             __SCREAMING_SNAKE_CASE       :int		    =  attention_ratio
             __SCREAMING_SNAKE_CASE       :List[Any]		    =  mlp_ratio
             __SCREAMING_SNAKE_CASE       :str		    =  initializer_range
             __SCREAMING_SNAKE_CASE       :Optional[Any]		    =  [
                 ['''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  _SCREAMING_SNAKE_CASE(       A  ):
       SCREAMING_SNAKE_CASE_       :				int     						=  version.parse('''1.11'''  )




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





             """simple docstring"""






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




       @property
       def    _UpperCamelCase					(						self							)      ->				float:





             """simple docstring"""






             return 1E-4