






'''simple docstring'''







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCamelCase    :      List[Any]  			=		{'configuration_vit_msn': ['VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP', 'ViTMSNConfig']}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCamelCase    :      int  			=		[
							    'VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'ViTMSNModel',
							    'ViTMSNForImageClassification',
							    'ViTMSNPreTrainedModel',
							]

if TYPE_CHECKING:
							from .configuration_vit_msn import VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTMSNConfig

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_vit_msn import (
														    VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST,
														    ViTMSNForImageClassification,
														    ViTMSNModel,
														    ViTMSNPreTrainedModel,
														)

else:
							import sys

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









'''simple docstring'''







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


UpperCamelCase    :      Tuple  			=		logging.get_logger(__name__)

UpperCamelCase    :      List[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 		UpperCamelCase__    (a			):




		'''simple docstring'''





		_UpperCamelCase				  =					'donut-swin'

		_UpperCamelCase				  =					{
		    'num_attention_heads': 'num_heads',
		    'num_hidden_layers': 'num_layers',
		}






		def __init__(      self   ,_lowerCAmelCase=2_24   ,_lowerCAmelCase=4   ,_lowerCAmelCase=3   ,_lowerCAmelCase=96   ,_lowerCAmelCase=[2, 2, 6, 2]   ,_lowerCAmelCase=[3, 6, 12, 24]   ,_lowerCAmelCase=7   ,_lowerCAmelCase=4.0   ,_lowerCAmelCase=True   ,_lowerCAmelCase=0.0   ,_lowerCAmelCase=0.0   ,_lowerCAmelCase=0.1   ,_lowerCAmelCase="gelu"   ,_lowerCAmelCase=False   ,_lowerCAmelCase=0.02   ,_lowerCAmelCase=1E-5   ,**_lowerCAmelCase   ,):
								super().__init__(**_lowerCAmelCase       )

								lowerCamelCase__         =  image_size
								lowerCamelCase__         =  patch_size
								lowerCamelCase__         =  num_channels
								lowerCamelCase__         =  embed_dim
								lowerCamelCase__         =  depths
								lowerCamelCase__         =  len(_lowerCAmelCase       )
								lowerCamelCase__         =  num_heads
								lowerCamelCase__         =  window_size
								lowerCamelCase__         =  mlp_ratio
								lowerCamelCase__         =  qkv_bias
								lowerCamelCase__         =  hidden_dropout_prob
								lowerCamelCase__         =  attention_probs_dropout_prob
								lowerCamelCase__         =  drop_path_rate
								lowerCamelCase__         =  hidden_act
								lowerCamelCase__         =  use_absolute_embeddings
								lowerCamelCase__         =  layer_norm_eps
								lowerCamelCase__         =  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
								lowerCamelCase__         =  int(embed_dim * 2 ** (len(_lowerCAmelCase       ) - 1)       )

