


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							:	int					      =				logging.get_logger(__name__)

snake_case							:	Union[str, Any]					      =				{
    '''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 	snake_case_       (a__				):
					UpperCAmelCase__ :   Tuple   				=      '''levit'''
					def __init__(				self       :int      ,__snake_case       :List[Any]=2_24      ,__snake_case       :Union[str, Any]=3      ,__snake_case       :int=3      ,__snake_case       :Tuple=2      ,__snake_case       :Optional[int]=1      ,__snake_case       :List[str]=16      ,__snake_case       :Tuple=[1_28, 2_56, 3_84]      ,__snake_case       :List[str]=[4, 8, 12]      ,__snake_case       :Optional[int]=[4, 4, 4]      ,__snake_case       :Union[str, Any]=[16, 16, 16]      ,__snake_case       :int=0      ,__snake_case       :Union[str, Any]=[2, 2, 2]      ,__snake_case       :Optional[Any]=[2, 2, 2]      ,__snake_case       :Optional[Any]=0.02      ,**__snake_case       :List[Any]      ,) ->   str:
												super().__init__(**_lowerCamelCase				)
												a__					=					image_size
												a__					=					num_channels
												a__					=					kernel_size
												a__					=					stride
												a__					=					padding
												a__					=					hidden_sizes
												a__					=					num_attention_heads
												a__					=					depths
												a__					=					key_dim
												a__					=					drop_path_rate
												a__					=					patch_size
												a__					=					attention_ratio
												a__					=					mlp_ratio
												a__					=					initializer_range
												a__					=					[
												    ['''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 	snake_case_       (a__				):
					UpperCAmelCase__ :   Any   				=      version.parse('''1.11'''				)
					@property
					def 			lowerCamelCase__(				self       :Optional[int]				) ->   Optional[Any]:
												return OrderedDict(
												    [
												        ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
												    ]				)



					@property
					def 			lowerCamelCase__(				self       :int				) ->   Tuple:
												return 1E-4










snake_case							:	str					      =				{
    0: '''0''',
    1: '''1''',
    2: '''2''',
    3: '''3''',
    4: '''4''',
    5: '''5''',
    6: '''6''',
    7: '''7''',
    8: '''8''',
    9: '''9''',
    10: '''a''',
    11: '''b''',
    12: '''c''',
    13: '''d''',
    14: '''e''',
    15: '''f''',
}






def 							__lowercase       (			__lowerCAmelCase							:    float       ):
							assert type(__lowerCAmelCase       ) in (int, float) and decimal == int(__lowerCAmelCase       )
							a__					=					int(__lowerCAmelCase       )
							a__					=					''
							a__					=					False
							if decimal < 0:
														a__					=					True
														decimal *= -1
							while decimal > 0:
														a__				, a__					=					divmod(__lowerCAmelCase ,   1_6       )
														a__					=					values[remainder] + hexadecimal
							a__					=					'0x' + hexadecimal
							if negative:
														a__					=					'-' + hexadecimal
							return hexadecimal


if __name__ == "__main__":
						import doctest

						doctest.testmod()




