



from typing import Callable, Optional, Union

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


__A   			=logging.get_logger(__name__)

__A   			={
    '''microsoft/xprophetnet-large-wiki100-cased''': (
        '''https://huggingface.co/microsoft/xprophetnet-large-wiki100-cased/resolve/main/config.json'''
    ),
}

class 		UpperCAmelCase__			(			A__   ):




			'''simple docstring'''






			UpperCamelCase									=       """xlm-prophetnet"""
			UpperCamelCase									=       ["""past_key_values"""]
			UpperCamelCase									=       {
			    """num_attention_heads""": """num_encoder_attention_heads""",
			}




			def __init__(   self							: Optional[Any]       ,       a_							: Optional[float] = 0.1       ,       a_							: Optional[Union[str, Callable]] = "gelu"       ,       a_							: Optional[int] = 3_05_22       ,       a_							: Optional[int] = 10_24       ,       a_							: Optional[int] = 40_96       ,       a_							: Optional[int] = 12       ,       a_							: Optional[int] = 16       ,       a_							: Optional[int] = 40_96       ,       a_							: Optional[int] = 12       ,       a_							: Optional[int] = 16       ,       a_							: Optional[float] = 0.1       ,       a_							: Optional[float] = 0.1       ,       a_							: Optional[int] = 5_12       ,       a_							: Optional[float] = 0.0_2       ,       a_							: Optional[bool] = True       ,       a_							: Optional[bool] = True       ,       a_							: Optional[int] = 0       ,       a_							: Optional[int] = 2       ,       a_							: Optional[int] = 32       ,       a_							: Optional[int] = 1_28       ,       a_							: Optional[bool] = False       ,       a_							: Optional[float] = 0.0       ,       a_							: Optional[bool] = True       ,       a_							: Optional[int] = 0       ,       a_							: Optional[int] = 1       ,       a_							: Optional[int] = 2       ,       **a_							: str       ,       ):
					'''simple docstring'''





					__UpperCAmelCase    :     List[str]													=	vocab_size
					__UpperCAmelCase    :     Tuple													=	hidden_size
					__UpperCAmelCase    :     str													=	encoder_ffn_dim
					__UpperCAmelCase    :     Any													=	num_encoder_layers
					__UpperCAmelCase    :     Any													=	num_encoder_attention_heads
					__UpperCAmelCase    :     int													=	decoder_ffn_dim
					__UpperCAmelCase    :     Optional[int]													=	num_decoder_layers
					__UpperCAmelCase    :     str													=	num_decoder_attention_heads
					__UpperCAmelCase    :     Optional[Any]													=	max_position_embeddings
					__UpperCAmelCase    :     Optional[int]													=	init_std  # Normal(0, this parameter)
					__UpperCAmelCase    :     Dict													=	activation_function

					# parameters for xlmprophetnet
					__UpperCAmelCase    :     int													=	ngram
					__UpperCAmelCase    :     Optional[int]													=	num_buckets
					__UpperCAmelCase    :     Optional[int]													=	relative_max_distance
					__UpperCAmelCase    :     List[Any]													=	disable_ngram_loss
					__UpperCAmelCase    :     List[str]													=	eps

					# 3 Types of Dropout
					__UpperCAmelCase    :     str													=	attention_dropout
					__UpperCAmelCase    :     Tuple													=	activation_dropout
					__UpperCAmelCase    :     List[Any]													=	dropout

					__UpperCAmelCase    :     Any													=	use_cache

					super().__init__(
					    pad_token_id=_A       ,       bos_token_id=_A       ,       eos_token_id=_A       ,       is_encoder_decoder=_A       ,       add_cross_attention=_A       ,       decoder_start_token_id=_A       ,       **_A       ,       )




			@property
			def  snake_case__     (   self							: Tuple ):
					'''simple docstring'''





					return self.num_encoder_layers + self.num_decoder_layers




			@num_hidden_layers.setter
			def  snake_case__     (   self							: Optional[int]       ,       a_							: str ):
					'''simple docstring'''





					raise NotImplementedError(
					    '''This model does not support the setting of `num_hidden_layers`. Please set `num_encoder_layers` and'''
					    ''' `num_decoder_layers`.''' )






def       _snake_case	(   lowerCAmelCase							:   int   , lowerCAmelCase							:   int	):
		"""simple docstring"""







		while b:
				SCREAMING_SNAKE_CASE_      ,    SCREAMING_SNAKE_CASE_  :		int				      =    b, a % b
		return a




def       _snake_case	(   lowerCAmelCase							:   int   , lowerCAmelCase							:   int	):
		"""simple docstring"""







		return a if b == 0 else euclidean_gcd_recursive(lowerCAmelCase   , a % b	)




def       _snake_case	(   ):
		"""simple docstring"""







		print(f'euclidean_gcd(3, 5) = {euclidean_gcd(3   , 5	)}'	)
		print(f'euclidean_gcd(5, 3) = {euclidean_gcd(5   , 3	)}'	)
		print(f'euclidean_gcd(1, 3) = {euclidean_gcd(1   , 3	)}'	)
		print(f'euclidean_gcd(3, 6) = {euclidean_gcd(3   , 6	)}'	)
		print(f'euclidean_gcd(6, 3) = {euclidean_gcd(6   , 3	)}'	)

		print(f'euclidean_gcd_recursive(3, 5) = {euclidean_gcd_recursive(3   , 5	)}'	)
		print(f'euclidean_gcd_recursive(5, 3) = {euclidean_gcd_recursive(5   , 3	)}'	)
		print(f'euclidean_gcd_recursive(1, 3) = {euclidean_gcd_recursive(1   , 3	)}'	)
		print(f'euclidean_gcd_recursive(3, 6) = {euclidean_gcd_recursive(3   , 6	)}'	)
		print(f'euclidean_gcd_recursive(6, 3) = {euclidean_gcd_recursive(6   , 3	)}'	)


if __name__ == "__main__":
		main()
