

from typing import List, Optional, Union

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


A									=  logging.get_logger(__name__)

A									=  {
    'huggingface/informer-tourism-monthly': (
        'https://huggingface.co/huggingface/informer-tourism-monthly/resolve/main/config.json'
    ),
    # See all Informer models at https://huggingface.co/models?filter=informer
}


class SCREAMING_SNAKE_CASE	(		__snake_case				):






			"""simple docstring"""




			__A    	=	"""informer"""
			__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 = None			,					__UpperCamelCase = "mean"			,					__UpperCamelCase = 0			,					__UpperCamelCase = 0			,					__UpperCamelCase = 0			,					__UpperCamelCase = 0			,					__UpperCamelCase = None			,					__UpperCamelCase = None			,					__UpperCamelCase = 64			,					__UpperCamelCase = 32			,					__UpperCamelCase = 32			,					__UpperCamelCase = 2			,					__UpperCamelCase = 2			,					__UpperCamelCase = 2			,					__UpperCamelCase = 2			,					__UpperCamelCase = True			,					__UpperCamelCase = "gelu"			,					__UpperCamelCase = 0.05			,					__UpperCamelCase = 0.1			,					__UpperCamelCase = 0.1			,					__UpperCamelCase = 0.1			,					__UpperCamelCase = 0.1			,					__UpperCamelCase = 1_00			,					__UpperCamelCase = 0.02			,					__UpperCamelCase=True			,					__UpperCamelCase = "prob"			,					__UpperCamelCase = 5			,					__UpperCamelCase = True			,					**__UpperCamelCase			,					):

				"""simple docstring"""


				snake_case_   		=			prediction_length
				snake_case_   		=			context_length or prediction_length
				snake_case_   		=			distribution_output
				snake_case_   		=			loss
				snake_case_   		=			input_size
				snake_case_   		=			num_time_features
				snake_case_   		=			lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
				snake_case_   		=			scaling
				snake_case_   		=			num_dynamic_real_features
				snake_case_   		=			num_static_real_features
				snake_case_   		=			num_static_categorical_features

				# set cardinality
				if cardinality 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]

				# set embedding_dimension
				if embedding_dimension 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

				# Informer
				snake_case_   		=			attention_type
				snake_case_   		=			sampling_factor
				snake_case_   		=			distil

				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 ..utils import DummyObject, requires_backends


class SCREAMING_SNAKE_CASE	(		metaclass=__snake_case				):






			"""simple docstring"""




			__A    	=	["""flax""", """transformers"""]


			def __init__(     self			,					*__UpperCamelCase			,					**__UpperCamelCase				):

				"""simple docstring"""


				requires_backends(self			,					['flax', 'transformers']				)


			@classmethod
			def       __lowerCAmelCase			(     cls			,					*__UpperCamelCase			,					**__UpperCamelCase				):

				"""simple docstring"""


				requires_backends(cls			,					['flax', 'transformers']				)







			@classmethod
			def       __lowerCAmelCase			(     cls			,					*__UpperCamelCase			,					**__UpperCamelCase				):

				"""simple docstring"""


				requires_backends(cls			,					['flax', 'transformers']				)







class SCREAMING_SNAKE_CASE	(		metaclass=__snake_case				):






			"""simple docstring"""




			__A    	=	["""flax""", """transformers"""]


			def __init__(     self			,					*__UpperCamelCase			,					**__UpperCamelCase				):

				"""simple docstring"""


				requires_backends(self			,					['flax', 'transformers']				)


			@classmethod
			def       __lowerCAmelCase			(     cls			,					*__UpperCamelCase			,					**__UpperCamelCase				):

				"""simple docstring"""


				requires_backends(cls			,					['flax', 'transformers']				)







			@classmethod
			def       __lowerCAmelCase			(     cls			,					*__UpperCamelCase			,					**__UpperCamelCase				):

				"""simple docstring"""


				requires_backends(cls			,					['flax', 'transformers']				)







class SCREAMING_SNAKE_CASE	(		metaclass=__snake_case				):






			"""simple docstring"""




			__A    	=	["""flax""", """transformers"""]


			def __init__(     self			,					*__UpperCamelCase			,					**__UpperCamelCase				):

				"""simple docstring"""


				requires_backends(self			,					['flax', 'transformers']				)


			@classmethod
			def       __lowerCAmelCase			(     cls			,					*__UpperCamelCase			,					**__UpperCamelCase				):

				"""simple docstring"""


				requires_backends(cls			,					['flax', 'transformers']				)







			@classmethod
			def       __lowerCAmelCase			(     cls			,					*__UpperCamelCase			,					**__UpperCamelCase				):

				"""simple docstring"""


				requires_backends(cls			,					['flax', 'transformers']				)







class SCREAMING_SNAKE_CASE	(		metaclass=__snake_case				):






			"""simple docstring"""




			__A    	=	["""flax""", """transformers"""]


			def __init__(     self			,					*__UpperCamelCase			,					**__UpperCamelCase				):

				"""simple docstring"""


				requires_backends(self			,					['flax', 'transformers']				)


			@classmethod
			def       __lowerCAmelCase			(     cls			,					*__UpperCamelCase			,					**__UpperCamelCase				):

				"""simple docstring"""


				requires_backends(cls			,					['flax', 'transformers']				)







			@classmethod
			def       __lowerCAmelCase			(     cls			,					*__UpperCamelCase			,					**__UpperCamelCase				):

				"""simple docstring"""


				requires_backends(cls			,					['flax', 'transformers']				)
