
"""simple docstring"""





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


UpperCamelCase_       :    Dict						      =			logging.get_logger(__name__)

UpperCamelCase_       :    str						      =			{
    '''naver-clova-ix/donut-base''': '''https://huggingface.co/naver-clova-ix/donut-base/resolve/main/config.json''',
    # See all Donut models at https://huggingface.co/models?filter=donut-swin
}



class __lowerCAmelCase					(       _lowercase   ):




			"""simple docstring"""







			snake_case						   =					"donut-swin"

			snake_case						   =					{
			    "num_attention_heads": "num_heads",
			    "num_hidden_layers": "num_layers",
			}




			def __init__(					self    :       Union[str, Any]							, _snake_case    :       Optional[int]=224							, _snake_case    :       List[Any]=4							, _snake_case    :       str=3							, _snake_case    :       Optional[int]=96							, _snake_case    :       Optional[int]=[2, 2, 6, 2]							, _snake_case    :       Tuple=[3, 6, 12, 24]							, _snake_case    :       str=7							, _snake_case    :       str=4.0							, _snake_case    :       int=True							, _snake_case    :       Union[str, Any]=0.0							, _snake_case    :       Optional[Any]=0.0							, _snake_case    :       Tuple=0.1							, _snake_case    :       List[str]="gelu"							, _snake_case    :       int=False							, _snake_case    :       Optional[int]=0.0_2							, _snake_case    :       Any=1e-5							, **_snake_case    :       Optional[int]							, )   ->			Tuple:







								"""simple docstring"""
								super().__init__(**_snake_case						)

								A_								=    image_size
								A_								=    patch_size
								A_								=    num_channels
								A_								=    embed_dim
								A_								=    depths
								A_								=    len(_snake_case						)
								A_								=    num_heads
								A_								=    window_size
								A_								=    mlp_ratio
								A_								=    qkv_bias
								A_								=    hidden_dropout_prob
								A_								=    attention_probs_dropout_prob
								A_								=    drop_path_rate
								A_								=    hidden_act
								A_								=    use_absolute_embeddings
								A_								=    layer_norm_eps
								A_								=    initializer_range
								# we set the hidden_size attribute in order to make Swin work with VisionEncoderDecoderModel
								# this indicates the channel dimension after the last stage of the model
								A_								=    int(embed_dim * 2 ** (len(_snake_case						) - 1)						)






"""simple docstring"""





from typing import TYPE_CHECKING

from ....utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


UpperCamelCase_       :    Any						      =			{'''configuration_van''': ['''VAN_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''VanConfig''']}


try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		UpperCamelCase_       :    str						      =			[
		    '''VAN_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''VanForImageClassification''',
		    '''VanModel''',
		    '''VanPreTrainedModel''',
		]

if TYPE_CHECKING:
		from .configuration_van import VAN_PRETRAINED_CONFIG_ARCHIVE_MAP, VanConfig

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_van import (
				    VAN_PRETRAINED_MODEL_ARCHIVE_LIST,
				    VanForImageClassification,
				    VanModel,
				    VanPreTrainedModel,
				)

else:
		import sys

		UpperCamelCase_       :    Optional[Any]						      =			_LazyModule(__name__, globals()['''__file__'''], _import_structure)




