





"""simple docstring"""

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


UpperCamelCase     :    Any       =			logging.get_logger(__name__)

UpperCamelCase     :    Tuple       =			{
    'vinvino02/glpn-kitti': 'https://huggingface.co/vinvino02/glpn-kitti/resolve/main/config.json',
    # See all GLPN models at https://huggingface.co/models?filter=glpn
}

class __lowerCAmelCase		(				lowerCAmelCase__      ):
     lowercase						       =						"glpn"





     def __init__(     self     ,					__UpperCAmelCase=3     ,					__UpperCAmelCase=4     ,					__UpperCAmelCase=[2, 2, 2, 2]     ,					__UpperCAmelCase=[8, 4, 2, 1]     ,					__UpperCAmelCase=[32, 64, 160, 256]     ,					__UpperCAmelCase=[7, 3, 3, 3]     ,					__UpperCAmelCase=[4, 2, 2, 2]     ,					__UpperCAmelCase=[1, 2, 5, 8]     ,					__UpperCAmelCase=[4, 4, 4, 4]     ,					__UpperCAmelCase="gelu"     ,					__UpperCAmelCase=0.0     ,					__UpperCAmelCase=0.0     ,					__UpperCAmelCase=0.0_2     ,					__UpperCAmelCase=0.1     ,					__UpperCAmelCase=1E-6     ,					__UpperCAmelCase=64     ,					__UpperCAmelCase=10     ,					__UpperCAmelCase=-1     ,					**__UpperCAmelCase     ,					):

      '''simple docstring'''




      super().__init__(**_SCREAMING_SNAKE_CASE				)

      __UpperCamelCase      =	num_channels
      __UpperCamelCase      =	num_encoder_blocks
      __UpperCamelCase      =	depths
      __UpperCamelCase      =	sr_ratios
      __UpperCamelCase      =	hidden_sizes
      __UpperCamelCase      =	patch_sizes
      __UpperCamelCase      =	strides
      __UpperCamelCase      =	mlp_ratios
      __UpperCamelCase      =	num_attention_heads
      __UpperCamelCase      =	hidden_act
      __UpperCamelCase      =	hidden_dropout_prob
      __UpperCamelCase      =	attention_probs_dropout_prob
      __UpperCamelCase      =	initializer_range
      __UpperCamelCase      =	drop_path_rate
      __UpperCamelCase      =	layer_norm_eps
      __UpperCamelCase      =	decoder_hidden_size
      __UpperCamelCase      =	max_depth
      __UpperCamelCase      =	head_in_index





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



