





from typing import List, Optional

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


_snake_case           =			logging.get_logger(__name__)

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





class  lowerCAmelCase							(       lowercase_ ):
  __lowerCamelCase		=      'autoformer'
  __lowerCamelCase		=      {
      'hidden_size': 'd_model',
      'num_attention_heads': 'encoder_attention_heads',
      'num_hidden_layers': 'encoder_layers',
  }







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






     '''simple docstring'''





     lowercase__			       =  prediction_length
     lowercase__			       =  context_length if context_length is not None else prediction_length
     lowercase__			       =  distribution_output
     lowercase__			       =  loss
     lowercase__			       =  input_size
     lowercase__			       =  num_time_features
     lowercase__			       =  lags_sequence
     lowercase__			       =  scaling
     lowercase__			       =  num_dynamic_real_features
     lowercase__			       =  num_static_real_features
     lowercase__			       =  num_static_categorical_features
     if cardinality is not None and num_static_categorical_features > 0:
        if len(_lowercase ) != num_static_categorical_features:
           raise ValueError(
               "The cardinality should be a list of the same length as `num_static_categorical_features`" )
        lowercase__			       =  cardinality
     else:
        lowercase__			       =  [0]
     if embedding_dimension is not None and num_static_categorical_features > 0:
        if len(_lowercase ) != num_static_categorical_features:
           raise ValueError(
               "The embedding dimension should be a list of the same length as `num_static_categorical_features`" )
        lowercase__			       =  embedding_dimension
     else:
        lowercase__			       =  [min(50   ,							(cat + 1) // 2 ) for cat in self.cardinality]
     lowercase__			       =  num_parallel_samples

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

     lowercase__			       =  dropout
     lowercase__			       =  attention_dropout
     lowercase__			       =  activation_dropout
     lowercase__			       =  encoder_layerdrop
     lowercase__			       =  decoder_layerdrop

     lowercase__			       =  activation_function
     lowercase__			       =  init_std

     lowercase__			       =  use_cache

     # Autoformer
     lowercase__			       =  label_length
     lowercase__			       =  moving_average
     lowercase__			       =  autocorrelation_factor

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







  @property
  def   UpperCAmelCase					(      self  :Optional[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 __future__ import annotations


def _A       (   __magic_name__  , __magic_name__	):
   lowercase__			       =  []
   create_all_state(1  , __magic_name__  , __magic_name__  , []  , __magic_name__	)
   return result


def _A       (   __magic_name__  , __magic_name__  , __magic_name__  , __magic_name__  , __magic_name__  , ):
   if level == 0:
      total_list.append(current_list[:]	)
      return

   for i in range(__magic_name__  , total_number - level + 2	):
      current_list.append(__magic_name__	)
      create_all_state(i + 1  , __magic_name__  , level - 1  , __magic_name__  , __magic_name__	)
      current_list.pop()


def _A       (   __magic_name__	):
   for i in total_list:
      print(*__magic_name__	)


if __name__ == "__main__":
  _snake_case           =			4
  _snake_case           =			2
  _snake_case           =			generate_all_combinations(n, k)
  print_all_state(total_list)






