from typing import List

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


_lowercase		:				Optional[Any]	       =		logging.get_logger(__name__)

_lowercase		:				str	       =		{
    "snap-research/efficientformer-l1-300": (
        "https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json"
    ),
}





class 					__magic_name__		(					_UpperCAmelCase):
			UpperCamelCase__       = '''efficientformer'''







			def __init__(			self       :						Optional[int]       ,    lowercase_       :						Union[str, Any] = [3, 2, 6, 4]       ,    lowercase_       :						Tuple = [48, 96, 224, 448]       ,    lowercase_       :						int = [True, True, True, True]       ,    lowercase_       :						str = 448       ,    lowercase_       :						Optional[int] = 32       ,    lowercase_       :						Tuple = 4       ,    lowercase_       :						Optional[int] = 7       ,    lowercase_       :						Union[str, Any] = 5       ,    lowercase_       :						str = 8       ,    lowercase_       :						Dict = 4       ,    lowercase_       :						Tuple = 0.0       ,    lowercase_       :						Optional[int] = 16       ,    lowercase_       :						Any = 3       ,    lowercase_       :						Optional[Any] = 3       ,    lowercase_       :						int = 3       ,    lowercase_       :						Optional[Any] = 2       ,    lowercase_       :						Union[str, Any] = 1       ,    lowercase_       :						Dict = 0.0       ,    lowercase_       :						int = 1       ,    lowercase_       :						List[str] = True       ,    lowercase_       :						Optional[int] = True       ,    lowercase_       :						List[Any] = 1E-5       ,    lowercase_       :						Optional[Any] = "gelu"       ,    lowercase_       :						int = 0.02       ,    lowercase_       :						int = 1E-12       ,    lowercase_       :						Union[str, Any] = 224       ,    lowercase_       :						Optional[int] = 1E-05       ,    **lowercase_       :						str       ,    ):
										super().__init__(**__lowerCAmelCase					)

										lowercase_      :    Tuple       		= hidden_act
										lowercase_      :    Dict       		= hidden_dropout_prob
										lowercase_      :    Tuple       		= hidden_sizes
										lowercase_      :    Union[str, Any]       		= num_hidden_layers
										lowercase_      :    int       		= num_attention_heads
										lowercase_      :    Dict       		= initializer_range
										lowercase_      :    Union[str, Any]       		= layer_norm_eps
										lowercase_      :    Optional[Any]       		= patch_size
										lowercase_      :    Dict       		= num_channels
										lowercase_      :    Tuple       		= depths
										lowercase_      :    List[str]       		= mlp_expansion_ratio
										lowercase_      :    Optional[int]       		= downsamples
										lowercase_      :    Optional[Any]       		= dim
										lowercase_      :    Optional[int]       		= key_dim
										lowercase_      :    List[str]       		= attention_ratio
										lowercase_      :    int       		= resolution
										lowercase_      :    Any       		= pool_size
										lowercase_      :    Union[str, Any]       		= downsample_patch_size
										lowercase_      :    Dict       		= downsample_stride
										lowercase_      :    Optional[Any]       		= downsample_pad
										lowercase_      :    Any       		= drop_path_rate
										lowercase_      :    Optional[Any]       		= num_metaad_blocks
										lowercase_      :    Optional[int]       		= distillation
										lowercase_      :    Optional[int]       		= use_layer_scale
										lowercase_      :    List[Any]       		= layer_scale_init_value
										lowercase_      :    str       		= image_size
										lowercase_      :    Union[str, Any]       		= batch_norm_eps






'''simple docstring'''




from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_lowercase		:				List[Any]	       =		{"configuration_focalnet": ["FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "FocalNetConfig"]}


try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_lowercase		:				int	       =		[
						    "FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST",
						    "FocalNetForImageClassification",
						    "FocalNetForMaskedImageModeling",
						    "FocalNetBackbone",
						    "FocalNetModel",
						    "FocalNetPreTrainedModel",
						]

if TYPE_CHECKING:
						from .configuration_focalnet import FOCALNET_PRETRAINED_CONFIG_ARCHIVE_MAP, FocalNetConfig

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_focalnet import (
												    FOCALNET_PRETRAINED_MODEL_ARCHIVE_LIST,
												    FocalNetBackbone,
												    FocalNetForImageClassification,
												    FocalNetForMaskedImageModeling,
												    FocalNetModel,
												    FocalNetPreTrainedModel,
												)

else:
						import sys

						_lowercase		:				Union[str, Any]	       =		_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)





