





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


UpperCamelCase     :    Any       =			logging.get_logger(__name__)

UpperCamelCase     :    Tuple       =			{
    "facebook/data2vec-vision-base-ft": (
        "https://huggingface.co/facebook/data2vec-vision-base-ft/resolve/main/config.json"
    ),
}

class __lowerCAmelCase		(				lowercase__      ):
     lowercase						       =						'''data2vec-vision'''





     def __init__(     self     ,					__UpperCAmelCase=768     ,					__UpperCAmelCase=12     ,					__UpperCAmelCase=12     ,					__UpperCAmelCase=3072     ,					__UpperCAmelCase="gelu"     ,					__UpperCAmelCase=0.0     ,					__UpperCAmelCase=0.0     ,					__UpperCAmelCase=0.0_2     ,					__UpperCAmelCase=1E-12     ,					__UpperCAmelCase=224     ,					__UpperCAmelCase=16     ,					__UpperCAmelCase=3     ,					__UpperCAmelCase=False     ,					__UpperCAmelCase=False     ,					__UpperCAmelCase=False     ,					__UpperCAmelCase=False     ,					__UpperCAmelCase=0.1     ,					__UpperCAmelCase=0.1     ,					__UpperCAmelCase=True     ,					__UpperCAmelCase=[3, 5, 7, 11]     ,					__UpperCAmelCase=[1, 2, 3, 6]     ,					__UpperCAmelCase=True     ,					__UpperCAmelCase=0.4     ,					__UpperCAmelCase=256     ,					__UpperCAmelCase=1     ,					__UpperCAmelCase=False     ,					__UpperCAmelCase=255     ,					**__UpperCAmelCase     ,					):

      '''simple docstring'''




      super().__init__(**_a				)

      __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 __lowerCAmelCase		(				lowercase__      ):
     lowercase						       =						version.parse("1.11"      )





     @property
     def 						UpperCAmelCase (     self				):

      '''simple docstring'''




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







     @property
     def 						UpperCAmelCase (     self				):

      '''simple docstring'''




      return 1E-4





"""simple docstring"""

def 							A						(    snake_case				:int		)				->     int:
 __UpperCamelCase      =	abs(snake_case		)
 __UpperCamelCase      =	0
 while n > 0:
  res += n % 1_0
  n //= 1_0
 return res






def 							A						(    snake_case				:int		)				->     int:
 __UpperCamelCase      =	abs(snake_case		)
 return n if n < 1_0 else n % 1_0 + sum_of_digits(n // 1_0		)






def 							A						(    snake_case				:int		)				->     int:
 return sum(int(snake_case		) for c in str(abs(snake_case		)		)		)






def 							A						(    )				->     None:
 from collections.abc import Callable
 from timeit import timeit

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

 for value in (2_6_2_1_4_4, 1_1_2_5_8_9_9_9_0_6_8_4_2_6_2_4, 1_2_6_7_6_5_0_6_0_0_2_2_8_2_2_9_4_0_1_4_9_6_7_0_3_2_0_5_3_7_6):
  for func in (sum_of_digits, sum_of_digits_recursion, sum_of_digits_compact):
   benchmark_a_function(snake_case    , snake_case		)
  print()


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      benchmark()



