


from typing import List, Optional

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


__UpperCamelCase     		=							logging.get_logger(__name__)

__UpperCamelCase     		=							{
    'huggingface/autoformer-tourism-monthly': 'https://huggingface.co/huggingface/autoformer-tourism-monthly/resolve/main/config.json',
}







class 							lowerCamelCase__						(				UpperCAmelCase   ):






			"""simple docstring"""






			_UpperCamelCase		:       Union[str, Any] 			=		'autoformer'
			_UpperCamelCase		:       Optional[int] 			=		{
			    'hidden_size': 'd_model',
			    'num_attention_heads': 'encoder_attention_heads',
			    'num_hidden_layers': 'encoder_layers',
			}




			def __init__(				self   ,    snake_case = None   ,    snake_case = None   ,    snake_case = "student_t"   ,    snake_case = "nll"   ,    snake_case = 1   ,    snake_case = [1, 2, 3, 4, 5, 6, 7]   ,    snake_case = True   ,    snake_case = 0   ,    snake_case = 0   ,    snake_case = 0   ,    snake_case = 0   ,    snake_case = None   ,    snake_case = None   ,    snake_case = 64   ,    snake_case = 2   ,    snake_case = 2   ,    snake_case = 2   ,    snake_case = 2   ,    snake_case = 32   ,    snake_case = 32   ,    snake_case = "gelu"   ,    snake_case = 0.1   ,    snake_case = 0.1   ,    snake_case = 0.1   ,    snake_case = 0.1   ,    snake_case = 0.1   ,    snake_case = 100   ,    snake_case = 0.02   ,    snake_case = True   ,    snake_case=True   ,    snake_case = 10   ,    snake_case = 25   ,    snake_case = 3   ,    **snake_case   ,    ):

						'''simple docstring'''


						UpperCamelCase__       =							prediction_length
						UpperCamelCase__       =							context_length if context_length is not None else prediction_length
						UpperCamelCase__       =							distribution_output
						UpperCamelCase__       =							loss
						UpperCamelCase__       =							input_size
						UpperCamelCase__       =							num_time_features
						UpperCamelCase__       =							lags_sequence
						UpperCamelCase__       =							scaling
						UpperCamelCase__       =							num_dynamic_real_features
						UpperCamelCase__       =							num_static_real_features
						UpperCamelCase__       =							num_static_categorical_features
						if cardinality is not None and num_static_categorical_features > 0:
									if len(snake_case  ) != num_static_categorical_features:
												raise ValueError(
												    "The cardinality should be a list of the same length as `num_static_categorical_features`"  )
									UpperCamelCase__       =							cardinality
						else:
									UpperCamelCase__       =							[0]
						if embedding_dimension is not None and num_static_categorical_features > 0:
									if len(snake_case  ) != num_static_categorical_features:
												raise ValueError(
												    "The embedding dimension should be a list of the same length as `num_static_categorical_features`"  )
									UpperCamelCase__       =							embedding_dimension
						else:
									UpperCamelCase__       =							[min(50   ,    (cat + 1) // 2  ) for cat in self.cardinality]
						UpperCamelCase__       =							num_parallel_samples

						# Transformer architecture configuration
						UpperCamelCase__       =							input_size * len(self.lags_sequence  ) + self._number_of_features
						UpperCamelCase__       =							d_model
						UpperCamelCase__       =							encoder_attention_heads
						UpperCamelCase__       =							decoder_attention_heads
						UpperCamelCase__       =							encoder_ffn_dim
						UpperCamelCase__       =							decoder_ffn_dim
						UpperCamelCase__       =							encoder_layers
						UpperCamelCase__       =							decoder_layers

						UpperCamelCase__       =							dropout
						UpperCamelCase__       =							attention_dropout
						UpperCamelCase__       =							activation_dropout
						UpperCamelCase__       =							encoder_layerdrop
						UpperCamelCase__       =							decoder_layerdrop

						UpperCamelCase__       =							activation_function
						UpperCamelCase__       =							init_std

						UpperCamelCase__       =							use_cache

						# Autoformer
						UpperCamelCase__       =							label_length
						UpperCamelCase__       =							moving_average
						UpperCamelCase__       =							autocorrelation_factor

						super().__init__(is_encoder_decoder=snake_case   ,    **snake_case  )







			@property
			def 					snake_case__					(				self  ):

						'''simple docstring'''


						return (
						    sum(self.embedding_dimension  )
						    + self.num_dynamic_real_features
						    + self.num_time_features
						    + self.num_static_real_features
						    + self.input_size * 2  # the log1p(abs(loc)) and log(scale) features
						)






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__UpperCamelCase     		=							{
    'configuration_xlm_roberta_xl': [
        'XLM_ROBERTA_XL_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'XLMRobertaXLConfig',
        'XLMRobertaXLOnnxConfig',
    ],
}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__UpperCamelCase     		=							[
						    'XLM_ROBERTA_XL_PRETRAINED_MODEL_ARCHIVE_LIST',
						    'XLMRobertaXLForCausalLM',
						    'XLMRobertaXLForMaskedLM',
						    'XLMRobertaXLForMultipleChoice',
						    'XLMRobertaXLForQuestionAnswering',
						    'XLMRobertaXLForSequenceClassification',
						    'XLMRobertaXLForTokenClassification',
						    'XLMRobertaXLModel',
						    'XLMRobertaXLPreTrainedModel',
						]

if TYPE_CHECKING:
						from .configuration_xlm_roberta_xl import (
						    XLM_ROBERTA_XL_PRETRAINED_CONFIG_ARCHIVE_MAP,
						    XLMRobertaXLConfig,
						    XLMRobertaXLOnnxConfig,
						)

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_xlm_roberta_xl import (
												    XLM_ROBERTA_XL_PRETRAINED_MODEL_ARCHIVE_LIST,
												    XLMRobertaXLForCausalLM,
												    XLMRobertaXLForMaskedLM,
												    XLMRobertaXLForMultipleChoice,
												    XLMRobertaXLForQuestionAnswering,
												    XLMRobertaXLForSequenceClassification,
												    XLMRobertaXLForTokenClassification,
												    XLMRobertaXLModel,
												    XLMRobertaXLPreTrainedModel,
												)

else:
						import sys

						__UpperCamelCase     		=							_LazyModule(__name__, globals()['__file__'], _import_structure)


