




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


UpperCAmelCase_				 =					logging.get_logger(__name__)

UpperCAmelCase_				 =					{
    '''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   lowerCAmelCase_      (       snake_case__      ):







  '''simple docstring'''







  lowerCAmelCase_ :    int    =  '''levit'''


  def __init__(  self			:		int  ,						_UpperCAmelCase			:		str=2_24  ,						_UpperCAmelCase			:		str=3  ,						_UpperCAmelCase			:		Tuple=3  ,						_UpperCAmelCase			:		Union[str, Any]=2  ,						_UpperCAmelCase			:		Dict=1  ,						_UpperCAmelCase			:		List[str]=16  ,						_UpperCAmelCase			:		Any=[1_28, 2_56, 3_84]  ,						_UpperCAmelCase			:		int=[4, 8, 12]  ,						_UpperCAmelCase			:		Optional[int]=[4, 4, 4]  ,						_UpperCAmelCase			:		List[str]=[16, 16, 16]  ,						_UpperCAmelCase			:		List[Any]=0  ,						_UpperCAmelCase			:		Optional[int]=[2, 2, 2]  ,						_UpperCAmelCase			:		List[str]=[2, 2, 2]  ,						_UpperCAmelCase			:		List[str]=0.02  ,						**_UpperCAmelCase			:		str  ,						):






   """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   lowerCAmelCase_      (       snake_case__      ):







  '''simple docstring'''







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


  @property
  def 							SCREAMING_SNAKE_CASE__	(  self			:		Tuple       ):






   """simple docstring"""






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



  @property
  def 							SCREAMING_SNAKE_CASE__	(  self			:		List[str]       ):






   """simple docstring"""






   return 1E-4







from __future__ import annotations







def  _SCREAMING_SNAKE_CASE				(   a  )      ->      int:
					if not nums:
										return 0
					__A	:						Optional[int]       =				nums[0]
					__A	:						str       =				0
					for num in nums[1:]:
										__A    ,				__A	:						Tuple       =				(
										    max_excluding + num,
										    max(a					,						a  ),
										)
					return max(a					,						a  )


if __name__ == "__main__":
				import doctest

				doctest.testmod()




