

import math
from timeit import timeit





def 	snake_case_      (__A     :						int     )			->	int:
   __lowerCAmelCase  :			Union[str, Any]					    =						0
   __lowerCAmelCase  :			Optional[Any]					    =						abs(__A     )
   while True:
      __lowerCAmelCase  :			str					    =						n // 1_0
      digits += 1
      if n == 0:
         break
   return digits





def 	snake_case_      (__A     :						int     )			->	int:
   return 1 if n == 0 else math.floor(math.log(abs(__A     )					,   1_0     ) + 1     )





def 	snake_case_      (__A     :						int     )			->	int:
   return len(str(abs(__A     )     )     )





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

   def benchmark_a_function(__A     :						Callable					,   __A     :						int     ) -> None:
      __lowerCAmelCase  :			Optional[int]					    =						f'''{func.__name__}({value})'''
      __lowerCAmelCase  :			Dict					    =						timeit(f'''__main__.{call}'''					,   setup="""import __main__"""     )
      print(f'''{call}: {func(__A     )} -- {timing} 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 (num_digits, num_digits_fast, num_digits_faster):
         benchmark_a_function(__A					,   __A     )
      print()


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   benchmark()








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


_lowerCamelCase					:     List[str]					  =  logging.get_logger(__name__)

_lowerCamelCase					:     List[str]					  =  {
    "ZinengTang/tvlt-base": "https://huggingface.co/ZinengTang/tvlt-base/blob/main/config.json",
}
class 				__snake_case     (_a						):
				lowerCAmelCase__			=   "tvlt"



				def __init__(					self					:						Dict						,		_UpperCAmelCase					:						Any=224						,		_UpperCAmelCase					:						Any=2048						,		_UpperCAmelCase					:						Optional[int]=128						,		_UpperCAmelCase					:						Tuple=[16, 16]						,		_UpperCAmelCase					:						Optional[int]=[16, 16]						,		_UpperCAmelCase					:						Tuple=3						,		_UpperCAmelCase					:						str=1						,		_UpperCAmelCase					:						Dict=8						,		_UpperCAmelCase					:						Any=768						,		_UpperCAmelCase					:						Dict=12						,		_UpperCAmelCase					:						Any=12						,		_UpperCAmelCase					:						Optional[Any]=3072						,		_UpperCAmelCase					:						Tuple="gelu"						,		_UpperCAmelCase					:						List[str]=0.0						,		_UpperCAmelCase					:						Any=0.0						,		_UpperCAmelCase					:						Optional[int]=0.02						,		_UpperCAmelCase					:						int=1E-6						,		_UpperCAmelCase					:						str=True						,		_UpperCAmelCase					:						Dict=False						,		_UpperCAmelCase					:						str=16						,		_UpperCAmelCase					:						List[Any]=512						,		_UpperCAmelCase					:						Optional[Any]=8						,		_UpperCAmelCase					:						Optional[Any]=2048						,		_UpperCAmelCase					:						Optional[int]=0.75						,		_UpperCAmelCase					:						List[Any]=0.15						,		_UpperCAmelCase					:						int="frame-level"						,		_UpperCAmelCase					:						Union[str, Any]=True						,		_UpperCAmelCase					:						Optional[int]=True						,		_UpperCAmelCase					:						Any="classification"						,		**_UpperCAmelCase					:						Tuple						,		)     ->			List[str]:





								'''simple docstring'''




								super().__init__(**_UpperCAmelCase					)

								if audio_mask_type not in ("frame-level", "patch_level"):
												raise ValueError(
												    """audio_mask_type must be one of two acceptable strategies - {'frame_level', 'patch-level') """
												    f"got {audio_mask_type}"					)

								_lowerCAmelCase			:			Tuple        =					image_size
								_lowerCAmelCase			:			List[str]        =					spectrogram_length
								_lowerCAmelCase			:			str        =					frequency_length
								_lowerCAmelCase			:			Dict        =					image_patch_size
								_lowerCAmelCase			:			Tuple        =					audio_patch_size
								_lowerCAmelCase			:			str        =					num_image_channels
								_lowerCAmelCase			:			Dict        =					num_audio_channels
								_lowerCAmelCase			:			str        =					num_frames

								_lowerCAmelCase			:			Any        =					hidden_size
								_lowerCAmelCase			:			List[str]        =					num_hidden_layers
								_lowerCAmelCase			:			Union[str, Any]        =					num_attention_heads
								_lowerCAmelCase			:			List[Any]        =					intermediate_size
								_lowerCAmelCase			:			Any        =					hidden_act
								_lowerCAmelCase			:			Any        =					hidden_dropout_prob
								_lowerCAmelCase			:			Union[str, Any]        =					attention_probs_dropout_prob
								_lowerCAmelCase			:			str        =					initializer_range
								_lowerCAmelCase			:			Tuple        =					layer_norm_eps
								_lowerCAmelCase			:			str        =					qkv_bias
								_lowerCAmelCase			:			Tuple        =					use_mean_pooling

								_lowerCAmelCase			:			Union[str, Any]        =					decoder_num_attention_heads
								_lowerCAmelCase			:			int        =					decoder_hidden_size
								_lowerCAmelCase			:			List[str]        =					decoder_num_hidden_layers
								_lowerCAmelCase			:			Optional[int]        =					decoder_intermediate_size
								_lowerCAmelCase			:			Any        =					pixel_mask_ratio
								_lowerCAmelCase			:			int        =					audio_mask_ratio
								_lowerCAmelCase			:			Optional[int]        =					audio_mask_type

								_lowerCAmelCase			:			Dict        =					task_matching
								_lowerCAmelCase			:			Any        =					task_mae
								_lowerCAmelCase			:			int        =					loss_type

