


"""simple docstring"""







from typing import TYPE_CHECKING

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


a__    :							Optional[Any]            =					{'''configuration_deit''': ['''DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''DeiTConfig''', '''DeiTOnnxConfig''']}

try:
		if not is_vision_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		a__    :							Tuple            =					['''DeiTFeatureExtractor''']
		a__    :							List[str]            =					['''DeiTImageProcessor''']

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

try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		a__    :							Optional[Any]            =					[
		    '''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__    :							Union[str, Any]            =					_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)




"""simple docstring"""







from typing import List

from ...configuration_utils import PretrainedConfig
from ...utils import logging


a__    :							Tuple            =					logging.get_logger(__name__)

a__    :							List[Any]            =					{
    '''snap-research/efficientformer-l1-300''': (
        '''https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json'''
    ),
}




class 			UpperCamelCase_     (			UpperCamelCase):

	"""simple docstring"""





	snake_case__    :  Any    =      "efficientformer"




	def __init__(			self      :    Any      ,      UpperCAmelCase__      :    List[int] = [3, 2, 6, 4]      ,      UpperCAmelCase__      :    List[int] = [4_8, 9_6, 2_2_4, 4_4_8]      ,      UpperCAmelCase__      :    List[bool] = [True, True, True, True]      ,      UpperCAmelCase__      :    int = 4_4_8      ,      UpperCAmelCase__      :    int = 3_2      ,      UpperCAmelCase__      :    int = 4      ,      UpperCAmelCase__      :    int = 7      ,      UpperCAmelCase__      :    int = 5      ,      UpperCAmelCase__      :    int = 8      ,      UpperCAmelCase__      :    int = 4      ,      UpperCAmelCase__      :    float = 0.0      ,      UpperCAmelCase__      :    int = 1_6      ,      UpperCAmelCase__      :    int = 3      ,      UpperCAmelCase__      :    int = 3      ,      UpperCAmelCase__      :    int = 3      ,      UpperCAmelCase__      :    int = 2      ,      UpperCAmelCase__      :    int = 1      ,      UpperCAmelCase__      :    float = 0.0      ,      UpperCAmelCase__      :    int = 1      ,      UpperCAmelCase__      :    bool = True      ,      UpperCAmelCase__      :    bool = True      ,      UpperCAmelCase__      :    float = 1E-5      ,      UpperCAmelCase__      :    str = "gelu"      ,      UpperCAmelCase__      :    float = 0.02      ,      UpperCAmelCase__      :    float = 1E-12      ,      UpperCAmelCase__      :    int = 2_2_4      ,      UpperCAmelCase__      :    float = 1E-05      ,      **UpperCAmelCase__      :    Tuple      ,      )	->     None:
						super().__init__(**UpperCAmelCase__       )

						__SCREAMING_SNAKE_CASE						       =    hidden_act
						__SCREAMING_SNAKE_CASE						       =    hidden_dropout_prob
						__SCREAMING_SNAKE_CASE						       =    hidden_sizes
						__SCREAMING_SNAKE_CASE						       =    num_hidden_layers
						__SCREAMING_SNAKE_CASE						       =    num_attention_heads
						__SCREAMING_SNAKE_CASE						       =    initializer_range
						__SCREAMING_SNAKE_CASE						       =    layer_norm_eps
						__SCREAMING_SNAKE_CASE						       =    patch_size
						__SCREAMING_SNAKE_CASE						       =    num_channels
						__SCREAMING_SNAKE_CASE						       =    depths
						__SCREAMING_SNAKE_CASE						       =    mlp_expansion_ratio
						__SCREAMING_SNAKE_CASE						       =    downsamples
						__SCREAMING_SNAKE_CASE						       =    dim
						__SCREAMING_SNAKE_CASE						       =    key_dim
						__SCREAMING_SNAKE_CASE						       =    attention_ratio
						__SCREAMING_SNAKE_CASE						       =    resolution
						__SCREAMING_SNAKE_CASE						       =    pool_size
						__SCREAMING_SNAKE_CASE						       =    downsample_patch_size
						__SCREAMING_SNAKE_CASE						       =    downsample_stride
						__SCREAMING_SNAKE_CASE						       =    downsample_pad
						__SCREAMING_SNAKE_CASE						       =    drop_path_rate
						__SCREAMING_SNAKE_CASE						       =    num_metaad_blocks
						__SCREAMING_SNAKE_CASE						       =    distillation
						__SCREAMING_SNAKE_CASE						       =    use_layer_scale
						__SCREAMING_SNAKE_CASE						       =    layer_scale_init_value
						__SCREAMING_SNAKE_CASE						       =    image_size
						__SCREAMING_SNAKE_CASE						       =    batch_norm_eps
