




import timeit





class 		A__				:






	def __init__(	self				,     lowerCamelCase						)      ->   str:




						"""simple docstring"""






						if isinstance(lowerCamelCase				,     lowerCamelCase						):  # Initializes a matrix identical to the one provided.
											__magic_name__					:							Tuple		   =							arg
											__magic_name__					:							str		   =							len(lowerCamelCase						)
						else:  # Initializes a square matrix of the given size and set values to zero.
											__magic_name__					:							List[Any]		   =							arg
											__magic_name__					:							Dict		   =							[[0 for _ in range(self.n						)] for _ in range(self.n						)]






	def __mul__(	self				,     lowerCamelCase						)      ->   Any:




						"""simple docstring"""






						__magic_name__					:							Optional[Any]		   =							Matrix(self.n						)
						for i in range(self.n						):
											for j in range(self.n						):
																for k in range(self.n						):
																					matrix.t[i][j] += self.t[i][k] * b.t[k][j]
						return matrix







def  lowerCAmelCase  (	UpperCAmelCase,	UpperCAmelCase       )  ->int:






					"""simple docstring"""






					__magic_name__					:							Union[str, Any]		   =							Matrix([[1, 0], [0, 1]]       )
					while b > 0:
										if b & 1:
															matrix *= a
										a *= a
										b >>= 1
					return matrix







def  lowerCAmelCase  (	UpperCAmelCase,	UpperCAmelCase,	UpperCAmelCase       )  ->int:






					"""simple docstring"""






					if n == 1:
										return fa
					elif n == 2:
										return fa
					__magic_name__					:							Optional[int]		   =							Matrix([[1, 1], [1, 0]]       )
					__magic_name__					:							Tuple		   =							modular_exponentiation(UpperCAmelCase,	n - 2       )
					return fa * matrix.t[0][0] + fa * matrix.t[0][1]







def  lowerCAmelCase  (	UpperCAmelCase,	UpperCAmelCase,	UpperCAmelCase       )  ->Dict:






					"""simple docstring"""






					if n == 1:
										return fa
					elif n == 2:
										return fa

					__magic_name__					:							List[str]		   =							fa
					__magic_name__					:							Tuple		   =							fa
					n -= 2

					while n > 0:
										__magic_name__   , __magic_name__					:							str		   =							fn_a + fn_a, fn_a
										n -= 1

					return fn_a







def  lowerCAmelCase  (	)  ->Union[str, Any]:






					"""simple docstring"""






					__magic_name__					:							List[str]		   =							'''
from random import randint
from __main__ import fibonacci_with_matrix_exponentiation
'''
					__magic_name__					:							str		   =							'''fibonacci_with_matrix_exponentiation(randint(1,70000), 1, 1)'''
					__magic_name__					:							str		   =							timeit.timeit(setup=UpperCAmelCase,	stmt=UpperCAmelCase,	number=100       )
					print('''With matrix exponentiation the average execution time is ''',	exec_time / 100       )
					return exec_time







def  lowerCAmelCase  (	)  ->Any:






					"""simple docstring"""






					__magic_name__					:							Optional[int]		   =							'''
from random import randint
from __main__ import simple_fibonacci
'''
					__magic_name__					:							str		   =							'''simple_fibonacci(randint(1,70000), 1, 1)'''
					__magic_name__					:							Tuple		   =							timeit.timeit(setup=UpperCAmelCase,	stmt=UpperCAmelCase,	number=100       )
					print(
					    '''Without matrix exponentiation the average execution time is ''',	exec_time / 100       )
					return exec_time







def  lowerCAmelCase  (	)  ->str:






					"""simple docstring"""






					matrix_exponentiation_time()
					simple_fibonacci_time()


if __name__ == "__main__":
				main()









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


lowercase_		=							logging.get_logger(__name__)

lowercase_		=							{
    '''uw-madison/yoso-4096''': '''https://huggingface.co/uw-madison/yoso-4096/resolve/main/config.json''',
    # See all YOSO models at https://huggingface.co/models?filter=yoso
}





class 		A__				(   __SCREAMING_SNAKE_CASE ):
	lowerCamelCase__		: Tuple				    ="yoso"






	def __init__(	self				,     lowerCamelCase=50265				,     lowerCamelCase=768				,     lowerCamelCase=12				,     lowerCamelCase=12				,     lowerCamelCase=3072				,     lowerCamelCase="gelu"				,     lowerCamelCase=0.1				,     lowerCamelCase=0.1				,     lowerCamelCase=4096				,     lowerCamelCase=1				,     lowerCamelCase=0.0_2				,     lowerCamelCase=1e-12				,     lowerCamelCase="absolute"				,     lowerCamelCase=True				,     lowerCamelCase=9				,     lowerCamelCase=64				,     lowerCamelCase=None				,     lowerCamelCase=True				,     lowerCamelCase=True				,     lowerCamelCase=1				,     lowerCamelCase=0				,     lowerCamelCase=2				,     **lowerCamelCase				,     )      ->   Tuple:




						"""simple docstring"""






						super().__init__(pad_token_id=lowerCamelCase				,     bos_token_id=lowerCamelCase				,     eos_token_id=lowerCamelCase				,     **lowerCamelCase						)

						__magic_name__					:							Union[str, Any]		   =							vocab_size
						__magic_name__					:							Union[str, Any]		   =							max_position_embeddings
						__magic_name__					:							Tuple		   =							hidden_size
						__magic_name__					:							Optional[Any]		   =							num_hidden_layers
						__magic_name__					:							Any		   =							num_attention_heads
						__magic_name__					:							List[str]		   =							intermediate_size
						__magic_name__					:							List[str]		   =							hidden_act
						__magic_name__					:							Tuple		   =							hidden_dropout_prob
						__magic_name__					:							str		   =							attention_probs_dropout_prob
						__magic_name__					:							str		   =							initializer_range
						__magic_name__					:							List[str]		   =							type_vocab_size
						__magic_name__					:							Dict		   =							layer_norm_eps
						__magic_name__					:							Any		   =							position_embedding_type
						__magic_name__					:							Optional[Any]		   =							use_expectation
						__magic_name__					:							Optional[Any]		   =							hash_code_len
						__magic_name__					:							Dict		   =							num_hash
						__magic_name__					:							str		   =							conv_window
						__magic_name__					:							Optional[Any]		   =							use_fast_hash
						__magic_name__					:							Union[str, Any]		   =							lsh_backward



