


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




		'''simple docstring'''







		SCREAMING_SNAKE_CASE_		:	Optional[Any]														=	"levit"







		def __init__(      self		,			lowerCAmelCase__=224		,			lowerCAmelCase__=3		,			lowerCAmelCase__=3		,			lowerCAmelCase__=2		,			lowerCAmelCase__=1		,			lowerCAmelCase__=16		,			lowerCAmelCase__=[128, 256, 384]		,			lowerCAmelCase__=[4, 8, 12]		,			lowerCAmelCase__=[4, 4, 4]		,			lowerCAmelCase__=[16, 16, 16]		,			lowerCAmelCase__=0		,			lowerCAmelCase__=[2, 2, 2]		,			lowerCAmelCase__=[2, 2, 2]		,			lowerCAmelCase__=0.02		,			**lowerCAmelCase__		,			)	->				int:
								super().__init__(**snake_case__							)
								SCREAMING_SNAKE_CASE						=   image_size
								SCREAMING_SNAKE_CASE						=   num_channels
								SCREAMING_SNAKE_CASE						=   kernel_size
								SCREAMING_SNAKE_CASE						=   stride
								SCREAMING_SNAKE_CASE						=   padding
								SCREAMING_SNAKE_CASE						=   hidden_sizes
								SCREAMING_SNAKE_CASE						=   num_attention_heads
								SCREAMING_SNAKE_CASE						=   depths
								SCREAMING_SNAKE_CASE						=   key_dim
								SCREAMING_SNAKE_CASE						=   drop_path_rate
								SCREAMING_SNAKE_CASE						=   patch_size
								SCREAMING_SNAKE_CASE						=   attention_ratio
								SCREAMING_SNAKE_CASE						=   mlp_ratio
								SCREAMING_SNAKE_CASE						=   initializer_range
								SCREAMING_SNAKE_CASE						=   [
								    ["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      (   A_       ):




		'''simple docstring'''







		SCREAMING_SNAKE_CASE_		:	Dict														=	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




__lowerCamelCase				=			{
    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      UpperCamelCase   (       __lowerCamelCase	:					float       ):
       assert type(__lowerCamelCase       ) in (int, float) and decimal == int(__lowerCamelCase       )
       snake_case			:  str     							= int(__lowerCamelCase       )
       snake_case			:  str     							= ""
       snake_case			:  str     							= False
       if decimal < 0:
              snake_case			:  Optional[Any]     							= True
              decimal *= -1
       while decimal > 0:
              snake_case							,   snake_case			:  Union[str, Any]     							= divmod(__lowerCamelCase							,   16       )
              snake_case			:  Tuple     							= values[remainder] + hexadecimal
       snake_case			:  Tuple     							= "0x" + hexadecimal
       if negative:
              snake_case			:  Any     							= "-" + hexadecimal
       return hexadecimal


if __name__ == "__main__":
   import doctest

   doctest.testmod()





