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__     (		__snake_case       ):



  """simple docstring"""






  lowerCAmelCase__		:						Tuple     		=			"levit"






  def __init__(					self:      Dict					,					__lowerCAmelCase:      Dict=224					,					__lowerCAmelCase:      Optional[int]=3					,					__lowerCAmelCase:      List[Any]=3					,					__lowerCAmelCase:      str=2					,					__lowerCAmelCase:      int=1					,					__lowerCAmelCase:      Dict=16					,					__lowerCAmelCase:      Any=[128, 256, 384]					,					__lowerCAmelCase:      Union[str, Any]=[4, 8, 12]					,					__lowerCAmelCase:      int=[4, 4, 4]					,					__lowerCAmelCase:      Optional[Any]=[16, 16, 16]					,					__lowerCAmelCase:      str=0					,					__lowerCAmelCase:      Dict=[2, 2, 2]					,					__lowerCAmelCase:      Optional[int]=[2, 2, 2]					,					__lowerCAmelCase:      Tuple=0.02					,					**__lowerCAmelCase:      Union[str, Any]					,					)			->			Any:




    '''simple docstring'''




    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__     (		__snake_case       ):



  """simple docstring"""






  lowerCAmelCase__		:						List[Any]     		=			version.parse('1.11'       )






  @property
  def 						_UpperCAmelCase					(					self:      Optional[Any] )			->			Dict:




    '''simple docstring'''




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






  @property
  def 						_UpperCAmelCase					(					self:      Any )			->			Optional[int]:




    '''simple docstring'''




    return 1E-4











import warnings


warnings.warn(
    'memory_utils has been reorganized to utils.memory. Import `find_executable_batchsize` from the main `__init__`: '
    '`from accelerate import find_executable_batch_size` to avoid this warning.',
    FutureWarning,
)



