



"""simple docstring"""





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


lowercase  							=					logging.get_logger(__name__)

lowercase  							=					{
    '''microsoft/beit-base-patch16-224-pt22k''': (
        '''https://huggingface.co/microsoft/beit-base-patch16-224-pt22k/resolve/main/config.json'''
    ),
    # See all BEiT models at https://huggingface.co/models?filter=beit
}




class 			lowercase__			(      A    ):
							'''simple docstring'''







							_UpperCAmelCase      				=					'''beit'''






							def __init__(  self	,       snake_case=8192	,       snake_case=768	,       snake_case=12	,       snake_case=12	,       snake_case=3072	,       snake_case="gelu"	,       snake_case=0.0	,       snake_case=0.0	,       snake_case=0.02	,       snake_case=1E-12	,       snake_case=224	,       snake_case=16	,       snake_case=3	,       snake_case=False	,       snake_case=False	,       snake_case=False	,       snake_case=False	,       snake_case=0.1	,       snake_case=0.1	,       snake_case=True	,       snake_case=[3, 5, 7, 11]	,       snake_case=[1, 2, 3, 6]	,       snake_case=True	,       snake_case=0.4	,       snake_case=256	,       snake_case=1	,       snake_case=False	,       snake_case=255	,       **snake_case	,       )			->							str:
									super().__init__(**snake_case						)

									_UpperCAmelCase							 =		vocab_size
									_UpperCAmelCase							 =		hidden_size
									_UpperCAmelCase							 =		num_hidden_layers
									_UpperCAmelCase							 =		num_attention_heads
									_UpperCAmelCase							 =		intermediate_size
									_UpperCAmelCase							 =		hidden_act
									_UpperCAmelCase							 =		hidden_dropout_prob
									_UpperCAmelCase							 =		attention_probs_dropout_prob
									_UpperCAmelCase							 =		initializer_range
									_UpperCAmelCase							 =		layer_norm_eps

									_UpperCAmelCase							 =		image_size
									_UpperCAmelCase							 =		patch_size
									_UpperCAmelCase							 =		num_channels
									_UpperCAmelCase							 =		use_mask_token
									_UpperCAmelCase							 =		use_absolute_position_embeddings
									_UpperCAmelCase							 =		use_relative_position_bias
									_UpperCAmelCase							 =		use_shared_relative_position_bias
									_UpperCAmelCase							 =		layer_scale_init_value
									_UpperCAmelCase							 =		drop_path_rate
									_UpperCAmelCase							 =		use_mean_pooling
									# decode head attributes (semantic segmentation)
									_UpperCAmelCase							 =		out_indices
									_UpperCAmelCase							 =		pool_scales
									# auxiliary head attributes (semantic segmentation)
									_UpperCAmelCase							 =		use_auxiliary_head
									_UpperCAmelCase							 =		auxiliary_loss_weight
									_UpperCAmelCase							 =		auxiliary_channels
									_UpperCAmelCase							 =		auxiliary_num_convs
									_UpperCAmelCase							 =		auxiliary_concat_input
									_UpperCAmelCase							 =		semantic_loss_ignore_index







class 			lowercase__			(      A    ):
							'''simple docstring'''







							_UpperCAmelCase      				=					version.parse('''1.11'''    )






							@property
							def        lowerCamelCase_   (  self						)			->							Mapping[str, Mapping[int, str]]:
									return OrderedDict(
									    [
									        ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
									    ]						)






							@property
							def        lowerCamelCase_   (  self						)			->							float:
									return 1E-4







"""simple docstring"""





def 	UpperCAmelCase     (		A	:						int       ):

		'''simple docstring'''


		_UpperCAmelCase							 =		abs(A       )
		_UpperCAmelCase							 =		0
		while n > 0:
				res += n % 10
				n //= 10
		return res




def 	UpperCAmelCase     (		A	:						int       ):

		'''simple docstring'''


		_UpperCAmelCase							 =		abs(A       )
		return n if n < 10 else n % 10 + sum_of_digits(n // 10       )




def 	UpperCAmelCase     (		A	:						int       ):

		'''simple docstring'''


		return sum(int(A       ) for c in str(abs(A       )       )       )




def 	UpperCAmelCase     (		):

		'''simple docstring'''


		from collections.abc import Callable
		from timeit import timeit

		def benchmark_a_function(A	:						Callable     ,				A	:						int       ) -> None:
				_UpperCAmelCase							 =		f'{func.__name__}({value})'
				_UpperCAmelCase							 =		timeit(f'__main__.{call}'     ,				setup='import __main__'       )
				print(f'{call:56} = {func(A       )} -- {timing:.4f} seconds'       )

		for value in (26_2144, 1125_8999_0684_2624, 126_7650_6002_2822_9401_4967_0320_5376):
				for func in (sum_of_digits, sum_of_digits_recursion, sum_of_digits_compact):
						benchmark_a_function(A     ,				A       )
				print()


if __name__ == "__main__":
					import doctest

					doctest.testmod()
					benchmark()


