

from typing import List, Optional

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


_UpperCAmelCase		:       Tuple						    =	logging.get_logger(__name__)

_UpperCAmelCase		:       Optional[Any]						    =	{
    """huggingface/autoformer-tourism-monthly""": """https://huggingface.co/huggingface/autoformer-tourism-monthly/resolve/main/config.json""",
}







class 			lowercase    (	lowercase_      ):
				__SCREAMING_SNAKE_CASE :			List[str]	      =      '''autoformer'''
				__SCREAMING_SNAKE_CASE :			Tuple	      =      {
				    '''hidden_size''': '''d_model''',
				    '''num_attention_heads''': '''encoder_attention_heads''',
				    '''num_hidden_layers''': '''encoder_layers''',
				}




				def __init__( self				,       snake_case = None				,       snake_case = None				,       snake_case = "student_t"				,       snake_case = "nll"				,       snake_case = 1				,       snake_case = [1, 2, 3, 4, 5, 6, 7]				,       snake_case = True				,       snake_case = 0				,       snake_case = 0				,       snake_case = 0				,       snake_case = 0				,       snake_case = None				,       snake_case = None				,       snake_case = 64				,       snake_case = 2				,       snake_case = 2				,       snake_case = 2				,       snake_case = 2				,       snake_case = 32				,       snake_case = 32				,       snake_case = "gelu"				,       snake_case = 0.1				,       snake_case = 0.1				,       snake_case = 0.1				,       snake_case = 0.1				,       snake_case = 0.1				,       snake_case = 100				,       snake_case = 0.02				,       snake_case = True				,       snake_case=True				,       snake_case = 10				,       snake_case = 25				,       snake_case = 3				,       **snake_case				,       ):
											# time series specific configuration
											snake_case_          =   prediction_length
											snake_case_          =   context_length if context_length is not None else prediction_length
											snake_case_          =   distribution_output
											snake_case_          =   loss
											snake_case_          =   input_size
											snake_case_          =   num_time_features
											snake_case_          =   lags_sequence
											snake_case_          =   scaling
											snake_case_          =   num_dynamic_real_features
											snake_case_          =   num_static_real_features
											snake_case_          =   num_static_categorical_features
											if cardinality is not None and num_static_categorical_features > 0:
																		if len(snake_case	) != 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]
											if embedding_dimension is not None and num_static_categorical_features > 0:
																		if len(snake_case	) != 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

											# Autoformer
											snake_case_          =   label_length
											snake_case_          =   moving_average
											snake_case_          =   autocorrelation_factor

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




				@property
				def    a							( self	):
											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  __lowerCamelCase     (			UpperCamelCase__       ,							UpperCamelCase__				):







							'''simple docstring'''






							snake_case_          =   []
							create_all_state(1       ,							UpperCamelCase__       ,							UpperCamelCase__       ,							[]       ,							UpperCamelCase__				)
							return result





def  __lowerCamelCase     (			UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__       ,							):







							'''simple docstring'''






							if level == 0:
														total_list.append(current_list[:]				)
														return

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





def  __lowerCamelCase     (			UpperCamelCase__				):







							'''simple docstring'''






							for i in total_list:
														print(*UpperCamelCase__				)


if __name__ == "__main__":
					_UpperCAmelCase		:       str						    =	4
					_UpperCAmelCase		:       Tuple						    =	2
					_UpperCAmelCase		:       Optional[int]						    =	generate_all_combinations(n, k)
					print_all_state(total_list)




