



from typing import List, Optional

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


lowerCamelCase__      =			logging.get_logger(__name__)

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






class  SCREAMING_SNAKE_CASE      (				UpperCAmelCase_       ):
							__lowerCamelCase						:						str     ='autoformer'
							__lowerCamelCase						:						str     ={
							    'hidden_size': 'd_model',
							    'num_attention_heads': 'encoder_attention_heads',
							    'num_hidden_layers': 'encoder_layers',
							}





							def __init__( self		:		List[Any]   ,					__lowercase		:		List[Any] = None   ,					__lowercase		:		List[str] = None   ,					__lowercase		:		Optional[Any] = "student_t"   ,					__lowercase		:		Tuple = "nll"   ,					__lowercase		:		str = 1   ,					__lowercase		:		List[Any] = [1, 2, 3, 4, 5, 6, 7]   ,					__lowercase		:		int = True   ,					__lowercase		:		Optional[int] = 0   ,					__lowercase		:		Any = 0   ,					__lowercase		:		Tuple = 0   ,					__lowercase		:		Dict = 0   ,					__lowercase		:		Optional[Any] = None   ,					__lowercase		:		Optional[int] = None   ,					__lowercase		:		Tuple = 64   ,					__lowercase		:		Dict = 2   ,					__lowercase		:		int = 2   ,					__lowercase		:		Tuple = 2   ,					__lowercase		:		Any = 2   ,					__lowercase		:		int = 32   ,					__lowercase		:		Union[str, Any] = 32   ,					__lowercase		:		str = "gelu"   ,					__lowercase		:		List[str] = 0.1   ,					__lowercase		:		List[str] = 0.1   ,					__lowercase		:		List[Any] = 0.1   ,					__lowercase		:		Tuple = 0.1   ,					__lowercase		:		List[str] = 0.1   ,					__lowercase		:		Optional[int] = 100   ,					__lowercase		:		Tuple = 0.02   ,					__lowercase		:		Tuple = True   ,					__lowercase		:		List[str]=True   ,					__lowercase		:		Any = 10   ,					__lowercase		:		List[str] = 25   ,					__lowercase		:		Dict = 3   ,					**__lowercase		:		str   ,					):

											'''simple docstring'''
											__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(__a						) != 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(__a						) != 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(50   ,					(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=__a   ,					**__a						)







							@property
							def     UpperCamelCase_       ( self		:		List[Any]						):

											'''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
											)





a_    :  Dict						  =		8.314462  # Unit - J mol-1 K-1

def      __lowercase(						UpperCAmelCase__ , UpperCAmelCase__ , UpperCAmelCase__			):


      """simple docstring"""



      if moles < 0 or kelvin < 0 or volume < 0:
            raise ValueError("Invalid inputs. Enter positive value."			)
      return moles * kelvin * UNIVERSAL_GAS_CONSTANT / volume

def      __lowercase(						UpperCAmelCase__ , UpperCAmelCase__ , UpperCAmelCase__			):


      """simple docstring"""



      if moles < 0 or kelvin < 0 or pressure < 0:
            raise ValueError("Invalid inputs. Enter positive value."			)
      return moles * kelvin * UNIVERSAL_GAS_CONSTANT / pressure


if __name__ == "__main__":
     from doctest import testmod

     testmod()