




"""simple docstring"""






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


lowercase__  		=		logging.get_logger(__name__)

lowercase__  		=		{
    '''facebook/dpr-ctx_encoder-single-nq-base''': (
        '''https://huggingface.co/facebook/dpr-ctx_encoder-single-nq-base/resolve/main/config.json'''
    ),
    '''facebook/dpr-question_encoder-single-nq-base''': (
        '''https://huggingface.co/facebook/dpr-question_encoder-single-nq-base/resolve/main/config.json'''
    ),
    '''facebook/dpr-reader-single-nq-base''': (
        '''https://huggingface.co/facebook/dpr-reader-single-nq-base/resolve/main/config.json'''
    ),
    '''facebook/dpr-ctx_encoder-multiset-base''': (
        '''https://huggingface.co/facebook/dpr-ctx_encoder-multiset-base/resolve/main/config.json'''
    ),
    '''facebook/dpr-question_encoder-multiset-base''': (
        '''https://huggingface.co/facebook/dpr-question_encoder-multiset-base/resolve/main/config.json'''
    ),
    '''facebook/dpr-reader-multiset-base''': (
        '''https://huggingface.co/facebook/dpr-reader-multiset-base/resolve/main/config.json'''
    ),
}






class lowerCAmelCase__			(  UpperCamelCase__		):






   '''simple docstring'''



   lowerCamelCase__   =    """dpr"""
   def __init__(						self						,   lowercase=30522						,   lowercase=768						,   lowercase=12						,   lowercase=12						,   lowercase=3072						,   lowercase="gelu"						,   lowercase=0.1						,   lowercase=0.1						,   lowercase=512						,   lowercase=2						,   lowercase=0.02						,   lowercase=1E-12						,   lowercase=0						,   lowercase="absolute"						,   lowercase = 0						,   **lowercase						,   ):
       super().__init__(pad_token_id=lowercase						,   **lowercase						)

       _lowerCamelCase  :    Optional[Any]					=					vocab_size
       _lowerCamelCase  :    Tuple					=					hidden_size
       _lowerCamelCase  :    Dict					=					num_hidden_layers
       _lowerCamelCase  :    int					=					num_attention_heads
       _lowerCamelCase  :    Tuple					=					hidden_act
       _lowerCamelCase  :    Union[str, Any]					=					intermediate_size
       _lowerCamelCase  :    Optional[int]					=					hidden_dropout_prob
       _lowerCamelCase  :    Tuple					=					attention_probs_dropout_prob
       _lowerCamelCase  :    Tuple					=					max_position_embeddings
       _lowerCamelCase  :    Any					=					type_vocab_size
       _lowerCamelCase  :    Optional[int]					=					initializer_range
       _lowerCamelCase  :    List[str]					=					layer_norm_eps
       _lowerCamelCase  :    Optional[int]					=					projection_dim
       _lowerCamelCase  :    List[str]					=					position_embedding_type





"""simple docstring"""






def   _snake_case    (       lowercase__	):
				_lowerCamelCase  :    List[str]					=					abs(lowercase__	)
				_lowerCamelCase  :    Optional[int]					=					0
				while n > 0:
								res += n % 10
								n //= 10
				return res







def   _snake_case    (       lowercase__	):
				_lowerCamelCase  :    List[str]					=					abs(lowercase__	)
				return n if n < 10 else n % 10 + sum_of_digits(n // 10	)







def   _snake_case    (       lowercase__	):
				return sum(int(lowercase__	) for c in str(abs(lowercase__	)	)	)







def   _snake_case    (       ):
				from collections.abc import Callable
				from timeit import timeit

				def benchmark_a_function(lowercase__							,					lowercase__	) -> None:
								_lowerCamelCase  :    int					=					f'''{func.__name__}({value})'''
								_lowerCamelCase  :    Optional[Any]					=					timeit(f'''__main__.{call}'''							,					setup='import __main__'	)
								print(f'''{call:56} = {func(lowercase__	)} -- {timing:.4f} seconds'''	)

				for value in (262144, 1125899906842624, 1267650600228229401496703205376):
								for func in (sum_of_digits, sum_of_digits_recursion, sum_of_digits_compact):
												benchmark_a_function(lowercase__							,					lowercase__	)
								print()


if __name__ == "__main__":
			import doctest

			doctest.testmod()
			benchmark()