


from typing import List, Optional, Union

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


snake_case_						:			Dict													=							logging.get_logger(__name__)

snake_case_						:			Dict													=							{
    '''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 						A__							(		UpperCamelCase__  ):
						UpperCAmelCase             =						"informer"
						UpperCAmelCase             =						{
						    "hidden_size": "d_model",
						    "num_attention_heads": "encoder_attention_heads",
						    "num_hidden_layers": "encoder_layers",
						}




						def __init__(       self					:      List[str]				,    _a					:      Optional[int] = None				,    _a					:      Optional[int] = None				,    _a					:      str = "student_t"				,    _a					:      str = "nll"				,    _a					:      int = 1				,    _a					:      List[int] = None				,    _a					:      Optional[Union[str, bool]] = "mean"				,    _a					:      int = 0				,    _a					:      int = 0				,    _a					:      int = 0				,    _a					:      int = 0				,    _a					:      Optional[List[int]] = None				,    _a					:      Optional[List[int]] = None				,    _a					:      int = 64				,    _a					:      int = 32				,    _a					:      int = 32				,    _a					:      int = 2				,    _a					:      int = 2				,    _a					:      int = 2				,    _a					:      int = 2				,    _a					:      bool = True				,    _a					:      str = "gelu"				,    _a					:      float = 0.05				,    _a					:      float = 0.1				,    _a					:      float = 0.1				,    _a					:      float = 0.1				,    _a					:      float = 0.1				,    _a					:      int = 100				,    _a					:      float = 0.02				,    _a					:      Tuple=True				,    _a					:      str = "prob"				,    _a					:      int = 5				,    _a					:      bool = True				,    **_a					:      Optional[Any]				,    )							->     Any:


										"""simple docstring"""





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

										# set cardinality
										if cardinality and num_static_categorical_features > 0:
														if len(_a  ) != num_static_categorical_features:
																		raise ValueError(
																		    '''The cardinality should be a list of the same length as `num_static_categorical_features`'''  )
														_SCREAMING_SNAKE_CASE			  =cardinality
										else:
														_SCREAMING_SNAKE_CASE			  =[0]

										# set embedding_dimension
										if embedding_dimension and num_static_categorical_features > 0:
														if len(_a  ) != num_static_categorical_features:
																		raise ValueError(
																		    '''The embedding dimension should be a list of the same length as `num_static_categorical_features`'''  )
														_SCREAMING_SNAKE_CASE			  =embedding_dimension
										else:
														_SCREAMING_SNAKE_CASE			  =[min(50				,    (cat + 1) // 2  ) for cat in self.cardinality]

										_SCREAMING_SNAKE_CASE			  =num_parallel_samples

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

										_SCREAMING_SNAKE_CASE			  =dropout
										_SCREAMING_SNAKE_CASE			  =attention_dropout
										_SCREAMING_SNAKE_CASE			  =activation_dropout
										_SCREAMING_SNAKE_CASE			  =encoder_layerdrop
										_SCREAMING_SNAKE_CASE			  =decoder_layerdrop

										_SCREAMING_SNAKE_CASE			  =activation_function
										_SCREAMING_SNAKE_CASE			  =init_std

										_SCREAMING_SNAKE_CASE			  =use_cache

										# Informer
										_SCREAMING_SNAKE_CASE			  =attention_type
										_SCREAMING_SNAKE_CASE			  =sampling_factor
										_SCREAMING_SNAKE_CASE			  =distil

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




						@property
						def 							__UpperCamelCase				(       self					:      Tuple  )							->     int:


										"""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


snake_case_						:			List[Any]													=							{
    '''configuration_graphormer''': ['''GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''GraphormerConfig'''],
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							snake_case_						:			str													=							[
							    '''GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST''',
							    '''GraphormerForGraphClassification''',
							    '''GraphormerModel''',
							    '''GraphormerPreTrainedModel''',
							]


if TYPE_CHECKING:
							from .configuration_graphormer import GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, GraphormerConfig

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_graphormer import (
														    GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
														    GraphormerForGraphClassification,
														    GraphormerModel,
														    GraphormerPreTrainedModel,
														)


else:
							import sys

							snake_case_						:			Union[str, Any]													=							_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)