from typing import List, Optional

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


lowerCamelCase_    :		Optional[Any]							=	logging.get_logger(__name__)

lowerCamelCase_    :		Dict							=	{
    """huggingface/autoformer-tourism-monthly""": """https://huggingface.co/huggingface/autoformer-tourism-monthly/resolve/main/config.json""",
}


class 						a__							(       __snake_case		):
			A__    :       List[str]        =      'autoformer'
			A__    :       Optional[Any]        =      {
			    'hidden_size': 'd_model',
			    'num_attention_heads': 'encoder_attention_heads',
			    'num_hidden_layers': 'encoder_layers',
			}



			def __init__(						self				,						UpperCAmelCase = None				,						UpperCAmelCase = None				,						UpperCAmelCase = "student_t"				,						UpperCAmelCase = "nll"				,						UpperCAmelCase = 1				,						UpperCAmelCase = [1, 2, 3, 4, 5, 6, 7]				,						UpperCAmelCase = True				,						UpperCAmelCase = 0				,						UpperCAmelCase = 0				,						UpperCAmelCase = 0				,						UpperCAmelCase = 0				,						UpperCAmelCase = None				,						UpperCAmelCase = None				,						UpperCAmelCase = 6_4				,						UpperCAmelCase = 2				,						UpperCAmelCase = 2				,						UpperCAmelCase = 2				,						UpperCAmelCase = 2				,						UpperCAmelCase = 3_2				,						UpperCAmelCase = 3_2				,						UpperCAmelCase = "gelu"				,						UpperCAmelCase = 0.1				,						UpperCAmelCase = 0.1				,						UpperCAmelCase = 0.1				,						UpperCAmelCase = 0.1				,						UpperCAmelCase = 0.1				,						UpperCAmelCase = 1_0_0				,						UpperCAmelCase = 0.02				,						UpperCAmelCase = True				,						UpperCAmelCase=True				,						UpperCAmelCase = 1_0				,						UpperCAmelCase = 2_5				,						UpperCAmelCase = 3				,						**UpperCAmelCase				,						)			->   List[str]:
								# time series specific configuration
								__a		 =       prediction_length
								__a		 =       context_length if context_length is not None else prediction_length
								__a		 =       distribution_output
								__a		 =       loss
								__a		 =       input_size
								__a		 =       num_time_features
								__a		 =       lags_sequence
								__a		 =       scaling
								__a		 =       num_dynamic_real_features
								__a		 =       num_static_real_features
								__a		 =       num_static_categorical_features
								if cardinality is not None and num_static_categorical_features > 0:
													if len(UpperCAmelCase   ) != num_static_categorical_features:
																		raise ValueError(
																		    'The cardinality should be a list of the same length as `num_static_categorical_features`'   )
													__a		 =       cardinality
								else:
													__a		 =       [0]
								if embedding_dimension is not None and num_static_categorical_features > 0:
													if len(UpperCAmelCase   ) != num_static_categorical_features:
																		raise ValueError(
																		    'The embedding dimension should be a list of the same length as `num_static_categorical_features`'   )
													__a		 =       embedding_dimension
								else:
													__a		 =       [min(5_0				,						(cat + 1) // 2   ) for cat in self.cardinality]
								__a		 =       num_parallel_samples

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

								__a		 =       dropout
								__a		 =       attention_dropout
								__a		 =       activation_dropout
								__a		 =       encoder_layerdrop
								__a		 =       decoder_layerdrop

								__a		 =       activation_function
								__a		 =       init_std

								__a		 =       use_cache

								# Autoformer
								__a		 =       label_length
								__a		 =       moving_average
								__a		 =       autocorrelation_factor

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







			@property
			def __SCREAMING_SNAKE_CASE							(						self   )			->   int:
								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 ..utils import DummyObject, requires_backends


class 						a__							(       metaclass=__snake_case		):
			A__    :       List[Any]        =      ['torch', 'transformers', 'onnx']



			def __init__(						self				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Any:
								requires_backends(self				,						['torch', 'transformers', 'onnx']   )



			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Union[str, Any]:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )







			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   List[str]:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )






class 						a__							(       metaclass=__snake_case		):
			A__    :       Union[str, Any]        =      ['torch', 'transformers', 'onnx']



			def __init__(						self				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   int:
								requires_backends(self				,						['torch', 'transformers', 'onnx']   )



			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   int:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )







			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Dict:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )






class 						a__							(       metaclass=__snake_case		):
			A__    :       Dict        =      ['torch', 'transformers', 'onnx']



			def __init__(						self				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Union[str, Any]:
								requires_backends(self				,						['torch', 'transformers', 'onnx']   )



			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Any:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )







			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   int:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )






class 						a__							(       metaclass=__snake_case		):
			A__    :       Union[str, Any]        =      ['torch', 'transformers', 'onnx']



			def __init__(						self				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Optional[Any]:
								requires_backends(self				,						['torch', 'transformers', 'onnx']   )



			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   int:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )







			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Union[str, Any]:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )






class 						a__							(       metaclass=__snake_case		):
			A__    :       Dict        =      ['torch', 'transformers', 'onnx']



			def __init__(						self				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Optional[int]:
								requires_backends(self				,						['torch', 'transformers', 'onnx']   )



			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Any:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )







			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   str:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )






class 						a__							(       metaclass=__snake_case		):
			A__    :       Tuple        =      ['torch', 'transformers', 'onnx']



			def __init__(						self				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   int:
								requires_backends(self				,						['torch', 'transformers', 'onnx']   )



			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   List[str]:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )







			@classmethod
			def __SCREAMING_SNAKE_CASE							(						cls				,						*UpperCAmelCase				,						**UpperCAmelCase   )			->   Any:
								requires_backends(cls				,						['torch', 'transformers', 'onnx']   )




