



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

lowerCAmelCase__		:					Tuple							={
    '''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_  (       UpperCamelCase_	):

						'''simple docstring'''




						UpperCamelCase__      :			Union[str, Any]      =  '''levit'''






						def __init__(   self				,							_A=224				,							_A=3				,							_A=3				,							_A=2				,							_A=1				,							_A=16				,							_A=[128, 256, 384]				,							_A=[4, 8, 12]				,							_A=[4, 4, 4]				,							_A=[16, 16, 16]				,							_A=0				,							_A=[2, 2, 2]				,							_A=[2, 2, 2]				,							_A=0.0_2				,							**_A				,							):







													'''simple docstring'''

													super().__init__(**_A		)
													__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        UpperCAmelCase_  (       UpperCamelCase_	):

						'''simple docstring'''




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






						@property
						def 	_A     (   self		):







													'''simple docstring'''

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






						@property
						def 	_A     (   self		):







													'''simple docstring'''

													return 1e-4











from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_torch_available,
)


lowerCAmelCase__		:					str							={'''configuration_vit_mae''': ['''VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''ViTMAEConfig''']}

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			lowerCAmelCase__		:					Optional[int]							=[
			    '''VIT_MAE_PRETRAINED_MODEL_ARCHIVE_LIST''',
			    '''ViTMAEForPreTraining''',
			    '''ViTMAELayer''',
			    '''ViTMAEModel''',
			    '''ViTMAEPreTrainedModel''',
			]

try:
			if not is_tf_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			lowerCAmelCase__		:					List[str]							=[
			    '''TFViTMAEForPreTraining''',
			    '''TFViTMAEModel''',
			    '''TFViTMAEPreTrainedModel''',
			]

if TYPE_CHECKING:
			from .configuration_vit_mae import VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTMAEConfig

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_vit_mae import (
						    VIT_MAE_PRETRAINED_MODEL_ARCHIVE_LIST,
						    ViTMAEForPreTraining,
						    ViTMAELayer,
						    ViTMAEModel,
						    ViTMAEPreTrainedModel,
						)

			try:
						if not is_tf_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_tf_vit_mae import TFViTMAEForPreTraining, TFViTMAEModel, TFViTMAEPreTrainedModel


else:
			import sys

			lowerCAmelCase__		:					Optional[int]							=_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)






