"""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   :						List[Any]      =    logging.get_logger(__name__)

_UpperCamelCase   :						Optional[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      UpperCAmelCase_	(    _a):
      lowerCamelCase__		:    List[str]   =  "levit"


      def __init__(   self		,			a=2_2_4		,			a=3		,			a=3		,			a=2		,			a=1		,			a=1_6		,			a=[1_2_8, 2_5_6, 3_8_4]		,			a=[4, 8, 1_2]		,			a=[4, 4, 4]		,			a=[1_6, 1_6, 1_6]		,			a=0		,			a=[2, 2, 2]		,			a=[2, 2, 2]		,			a=0.02		,			**a		,			)       ->					Tuple:
             super().__init__(**a							)
             lowercase__			:		List[Any]       =	image_size
             lowercase__			:		Optional[int]       =	num_channels
             lowercase__			:		Tuple       =	kernel_size
             lowercase__			:		Any       =	stride
             lowercase__			:		str       =	padding
             lowercase__			:		Tuple       =	hidden_sizes
             lowercase__			:		List[Any]       =	num_attention_heads
             lowercase__			:		Dict       =	depths
             lowercase__			:		List[str]       =	key_dim
             lowercase__			:		Any       =	drop_path_rate
             lowercase__			:		Optional[int]       =	patch_size
             lowercase__			:		Dict       =	attention_ratio
             lowercase__			:		Optional[int]       =	mlp_ratio
             lowercase__			:		Any       =	initializer_range
             lowercase__			:		Union[str, Any]       =	[
                 ['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_	(    _a):
      lowerCamelCase__		:    int   =  version.parse("1.11")


      @property
      def 		_UpperCAmelCase       (   self							)       ->					Mapping[str, Mapping[int, str]]:
             return OrderedDict(
                 [
                     ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
                 ]							)


      @property
      def 		_UpperCAmelCase       (   self							)       ->					float:
             return 1e-4



from typing import TYPE_CHECKING

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


__a  			=					{'configuration_deit': ['DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'DeiTConfig', 'DeiTOnnxConfig']}

try:
						if not is_vision_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__a  			=					['DeiTFeatureExtractor']
						__a  			=					['DeiTImageProcessor']

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__a  			=					[
						    'DEIT_PRETRAINED_MODEL_ARCHIVE_LIST',
						    'DeiTForImageClassification',
						    'DeiTForImageClassificationWithTeacher',
						    'DeiTForMaskedImageModeling',
						    'DeiTModel',
						    'DeiTPreTrainedModel',
						]

try:
						if not is_tf_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__a  			=					[
						    'TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST',
						    'TFDeiTForImageClassification',
						    'TFDeiTForImageClassificationWithTeacher',
						    'TFDeiTForMaskedImageModeling',
						    'TFDeiTModel',
						    'TFDeiTPreTrainedModel',
						]


if TYPE_CHECKING:
						from .configuration_deit import DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP, DeiTConfig, DeiTOnnxConfig

						try:
												if not is_vision_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .feature_extraction_deit import DeiTFeatureExtractor
												from .image_processing_deit import DeiTImageProcessor

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_deit import (
												    DEIT_PRETRAINED_MODEL_ARCHIVE_LIST,
												    DeiTForImageClassification,
												    DeiTForImageClassificationWithTeacher,
												    DeiTForMaskedImageModeling,
												    DeiTModel,
												    DeiTPreTrainedModel,
												)

						try:
												if not is_tf_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_tf_deit import (
												    TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST,
												    TFDeiTForImageClassification,
												    TFDeiTForImageClassificationWithTeacher,
												    TFDeiTForMaskedImageModeling,
												    TFDeiTModel,
												    TFDeiTPreTrainedModel,
												)


else:
						import sys

						__a  			=					_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)




