



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


SCREAMING_SNAKE_CASE__   			=   logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__   			=   {
    '''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  (		UpperCAmelCase_   ):
					"""simple docstring"""






					A__					:		str      							=     "donut-swin"

					A__					:		Tuple      							=     {
					    "num_attention_heads": "num_heads",
					    "num_hidden_layers": "num_layers",
					}



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






								"""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)       )







def 			lowerCamelCase__			(       _a):
	if not isinstance(_a				,      _a):
		SCREAMING_SNAKE_CASE :   Tuple					  =							f"Input value of [number={number}] must be an integer"
		raise TypeError(_a)
	if number < 0:
		return False
	SCREAMING_SNAKE_CASE :   Union[str, Any]					  =							number * number
	while number > 0:
		if number % 10 != number_square % 10:
			return False
		number //= 10
		number_square //= 10
	return True


if __name__ == "__main__":
			import doctest

			doctest.testmod()