

from typing import List, Optional

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


A											=     logging.get_logger(__name__)

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


class SCREAMING_SNAKE_CASE  (		__snake_case							):






			"""simple docstring"""




			__A						  =  """autoformer"""
			__A						  =  {
			    """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 = 64 ,				__UpperCamelCase = 2 ,				__UpperCamelCase = 2 ,				__UpperCamelCase = 2 ,				__UpperCamelCase = 2 ,				__UpperCamelCase = 32 ,				__UpperCamelCase = 32 ,				__UpperCamelCase = "gelu" ,				__UpperCamelCase = 0.1 ,				__UpperCamelCase = 0.1 ,				__UpperCamelCase = 0.1 ,				__UpperCamelCase = 0.1 ,				__UpperCamelCase = 0.1 ,				__UpperCamelCase = 1_00 ,				__UpperCamelCase = 0.02 ,				__UpperCamelCase = True ,				__UpperCamelCase=True ,				__UpperCamelCase = 10 ,				__UpperCamelCase = 25 ,				__UpperCamelCase = 3 ,				**__UpperCamelCase ,				):

				"""simple docstring"""


				snake_case_      		= prediction_length
				snake_case_      		= context_length if context_length is not None else prediction_length
				snake_case_      		= distribution_output
				snake_case_      		= loss
				snake_case_      		= input_size
				snake_case_      		= num_time_features
				snake_case_      		= lags_sequence
				snake_case_      		= scaling
				snake_case_      		= num_dynamic_real_features
				snake_case_      		= num_static_real_features
				snake_case_      		= 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`'							)
					snake_case_      		= cardinality
				else:
					snake_case_      		= [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`'							)
					snake_case_      		= embedding_dimension
				else:
					snake_case_      		= [min(50 ,				(cat + 1) // 2							) for cat in self.cardinality]
				snake_case_      		= num_parallel_samples

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

				snake_case_      		= dropout
				snake_case_      		= attention_dropout
				snake_case_      		= activation_dropout
				snake_case_      		= encoder_layerdrop
				snake_case_      		= decoder_layerdrop

				snake_case_      		= activation_function
				snake_case_      		= init_std

				snake_case_      		= use_cache

				# Autoformer
				snake_case_      		= label_length
				snake_case_      		= moving_average
				snake_case_      		= autocorrelation_factor

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







			@property
			def 			__lowerCAmelCase (    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_tokenizers_available,
    is_torch_available,
    is_vision_available,
)


A											=     {
    'configuration_perceiver': ['PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP', 'PerceiverConfig', 'PerceiverOnnxConfig'],
    'tokenization_perceiver': ['PerceiverTokenizer'],
}

try:
		if not is_vision_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		A											=     ['PerceiverFeatureExtractor']
		A											=     ['PerceiverImageProcessor']

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		A											=     [
		    'PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'PerceiverForImageClassificationConvProcessing',
		    'PerceiverForImageClassificationFourier',
		    'PerceiverForImageClassificationLearned',
		    'PerceiverForMaskedLM',
		    'PerceiverForMultimodalAutoencoding',
		    'PerceiverForOpticalFlow',
		    'PerceiverForSequenceClassification',
		    'PerceiverLayer',
		    'PerceiverModel',
		    'PerceiverPreTrainedModel',
		]


if TYPE_CHECKING:
		from .configuration_perceiver import PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP, PerceiverConfig, PerceiverOnnxConfig
		from .tokenization_perceiver import PerceiverTokenizer

		try:
				if not is_vision_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .feature_extraction_perceiver import PerceiverFeatureExtractor
				from .image_processing_perceiver import PerceiverImageProcessor

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_perceiver import (
				    PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    PerceiverForImageClassificationConvProcessing,
				    PerceiverForImageClassificationFourier,
				    PerceiverForImageClassificationLearned,
				    PerceiverForMaskedLM,
				    PerceiverForMultimodalAutoencoding,
				    PerceiverForOpticalFlow,
				    PerceiverForSequenceClassification,
				    PerceiverLayer,
				    PerceiverModel,
				    PerceiverPreTrainedModel,
				)

else:
		import sys

		A											=     _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)
