


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__    :Any       =				{
    '''sail/poolformer_s12''': '''https://huggingface.co/sail/poolformer_s12/resolve/main/config.json''',
    # See all PoolFormer models at https://huggingface.co/models?filter=poolformer
}

class 						__a (							UpperCAmelCase     ):
		_a      :    Union[str, Any]           =      'poolformer'
		def __init__(     self     ,       _SCREAMING_SNAKE_CASE=3     ,       _SCREAMING_SNAKE_CASE=16     ,       _SCREAMING_SNAKE_CASE=16     ,       _SCREAMING_SNAKE_CASE=3     ,       _SCREAMING_SNAKE_CASE=4.0     ,       _SCREAMING_SNAKE_CASE=[2, 2, 6, 2]     ,       _SCREAMING_SNAKE_CASE=[64, 128, 320, 512]     ,       _SCREAMING_SNAKE_CASE=[7, 3, 3, 3]     ,       _SCREAMING_SNAKE_CASE=[4, 2, 2, 2]     ,       _SCREAMING_SNAKE_CASE=[2, 1, 1, 1]     ,       _SCREAMING_SNAKE_CASE=4     ,       _SCREAMING_SNAKE_CASE=0.0     ,       _SCREAMING_SNAKE_CASE="gelu"     ,       _SCREAMING_SNAKE_CASE=True     ,       _SCREAMING_SNAKE_CASE=1e-5     ,       _SCREAMING_SNAKE_CASE=0.02     ,       **_SCREAMING_SNAKE_CASE     ,       )					->			List[Any]:




									"""simple docstring"""





									_UpperCAmelCase											=     num_channels
									_UpperCAmelCase											=     patch_size
									_UpperCAmelCase											=     stride
									_UpperCAmelCase											=     padding
									_UpperCAmelCase											=     pool_size
									_UpperCAmelCase											=     hidden_sizes
									_UpperCAmelCase											=     mlp_ratio
									_UpperCAmelCase											=     depths
									_UpperCAmelCase											=     patch_sizes
									_UpperCAmelCase											=     strides
									_UpperCAmelCase											=     num_encoder_blocks
									_UpperCAmelCase											=     drop_path_rate
									_UpperCAmelCase											=     hidden_act
									_UpperCAmelCase											=     use_layer_scale
									_UpperCAmelCase											=     layer_scale_init_value
									_UpperCAmelCase											=     initializer_range
									super().__init__(**_SCREAMING_SNAKE_CASE		)



class 						__a (							UpperCAmelCase     ):
		_a      :    List[str]           =      version.parse('1.11'     )
		@property
		def       UpperCAmelCase__							(     self		)					->			Mapping[str, Mapping[int, str]]:




									"""simple docstring"""





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






		@property
		def       UpperCAmelCase__							(     self		)					->			float:




									"""simple docstring"""





									return 2e-3




from typing import TYPE_CHECKING

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


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

try:
		if not is_vision_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowerCAmelCase__    :List[Any]       =				['''DeiTFeatureExtractor''']
		lowerCAmelCase__    :Union[str, Any]       =				['''DeiTImageProcessor''']

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

try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowerCAmelCase__    :Union[str, 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

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