






"""simple docstring"""







from typing import List, Optional, Union

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


_lowerCAmelCase            =	logging.get_logger(__name__)

_lowerCAmelCase            =	{
    '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      UpperCamelCase		(__snake_case     ):
						_SCREAMING_SNAKE_CASE  : Tuple												=		"""informer"""
						_SCREAMING_SNAKE_CASE  : Tuple												=		{
						    """hidden_size""": """d_model""",
						    """num_attention_heads""": """encoder_attention_heads""",
						    """num_hidden_layers""": """encoder_layers""",
						}






						def __init__(		self  :List[str]			, __magic_name__  :Optional[int] = None			, __magic_name__  :Optional[int] = None			, __magic_name__  :str = "student_t"			, __magic_name__  :str = "nll"			, __magic_name__  :int = 1			, __magic_name__  :List[int] = None			, __magic_name__  :Optional[Union[str, bool]] = "mean"			, __magic_name__  :int = 0			, __magic_name__  :int = 0			, __magic_name__  :int = 0			, __magic_name__  :int = 0			, __magic_name__  :Optional[List[int]] = None			, __magic_name__  :Optional[List[int]] = None			, __magic_name__  :int = 64			, __magic_name__  :int = 32			, __magic_name__  :int = 32			, __magic_name__  :int = 2			, __magic_name__  :int = 2			, __magic_name__  :int = 2			, __magic_name__  :int = 2			, __magic_name__  :bool = True			, __magic_name__  :str = "gelu"			, __magic_name__  :float = 0.05			, __magic_name__  :float = 0.1			, __magic_name__  :float = 0.1			, __magic_name__  :float = 0.1			, __magic_name__  :float = 0.1			, __magic_name__  :int = 100			, __magic_name__  :float = 0.02			, __magic_name__  :List[Any]=True			, __magic_name__  :str = "prob"			, __magic_name__  :int = 5			, __magic_name__  :bool = True			, **__magic_name__  :List[Any]			, )      ->Dict:
										# time series specific configuration
										lowercase    :      Tuple       = prediction_length
										lowercase    :      int       = context_length or prediction_length
										lowercase    :      List[Any]       = distribution_output
										lowercase    :      List[str]       = loss
										lowercase    :      List[Any]       = input_size
										lowercase    :      Union[str, Any]       = num_time_features
										lowercase    :      Optional[Any]       = lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
										lowercase    :      Optional[Any]       = scaling
										lowercase    :      List[str]       = num_dynamic_real_features
										lowercase    :      int       = num_static_real_features
										lowercase    :      Union[str, Any]       = num_static_categorical_features

										# set cardinality
										if cardinality and num_static_categorical_features > 0:
														if len(__magic_name__				) != num_static_categorical_features:
																		raise ValueError(
																		    """The cardinality should be a list of the same length as `num_static_categorical_features`"""				)
														lowercase    :      int       = cardinality
										else:
														lowercase    :      Union[str, Any]       = [0]

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

										lowercase    :      List[str]       = num_parallel_samples

										# Transformer architecture configuration
										lowercase    :      Any       = input_size * len(self.lags_sequence				) + self._number_of_features
										lowercase    :      int       = d_model
										lowercase    :      Dict       = encoder_attention_heads
										lowercase    :      Dict       = decoder_attention_heads
										lowercase    :      Optional[Any]       = encoder_ffn_dim
										lowercase    :      Tuple       = decoder_ffn_dim
										lowercase    :      Union[str, Any]       = encoder_layers
										lowercase    :      str       = decoder_layers

										lowercase    :      int       = dropout
										lowercase    :      List[Any]       = attention_dropout
										lowercase    :      Optional[Any]       = activation_dropout
										lowercase    :      List[str]       = encoder_layerdrop
										lowercase    :      Any       = decoder_layerdrop

										lowercase    :      List[str]       = activation_function
										lowercase    :      Tuple       = init_std

										lowercase    :      List[Any]       = use_cache

										# Informer
										lowercase    :      Tuple       = attention_type
										lowercase    :      List[str]       = sampling_factor
										lowercase    :      List[str]       = distil

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






						@property
						def      __snake_case      (		self  :Any				)      ->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
										)








"""simple docstring"""







def      UpperCamelCase       ( _A )     ->       int:
				lowercase    :      Dict       = 0
				while num > 0:
								digit_sum += num % 10
								num //= 10
				return digit_sum


def      UpperCamelCase       ( _A = 100 )     ->       int:
				lowercase    :      Union[str, Any]       = 1
				lowercase    :      Tuple       = 2

				for i in range(2  ,				max_n + 1 ):
								lowercase    :      Any       = pre_numerator
								lowercase    :      Dict       = 2 * i // 3 if i % 3 == 0 else 1
								lowercase    :      Optional[Any]       = cur_numerator
								lowercase    :      str       = e_cont * pre_numerator + temp

				return sum_digits(_A )


if __name__ == "__main__":
				print(F'{solution() = }')
