




'''simple docstring'''


from typing import List, Optional, Union

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


_snake_case				:				List[str]       							=		logging.get_logger(__name__)

_snake_case				:				int       							=		{
    'huggingface/time-series-transformer-tourism-monthly': (
        'https://huggingface.co/huggingface/time-series-transformer-tourism-monthly/resolve/main/config.json'
    ),
    # See all TimeSeriesTransformer models at https://huggingface.co/models?filter=time_series_transformer
}

class       A   (		_a   ):
							lowercase_          =    'time_series_transformer'
							lowercase_          =    {
							    'hidden_size': 'd_model',
							    'num_attention_heads': 'encoder_attention_heads',
							    'num_hidden_layers': 'encoder_layers',
							}







							def __init__(  self	:  Tuple							,      lowerCAmelCase_	:  Optional[int] = None							,      lowerCAmelCase_	:  Optional[int] = None							,      lowerCAmelCase_	:  str = "student_t"							,      lowerCAmelCase_	:  str = "nll"							,      lowerCAmelCase_	:  int = 1							,      lowerCAmelCase_	:  List[int] = [1, 2, 3, 4, 5, 6, 7]							,      lowerCAmelCase_	:  Optional[Union[str, bool]] = "mean"							,      lowerCAmelCase_	:  int = 0							,      lowerCAmelCase_	:  int = 0							,      lowerCAmelCase_	:  int = 0							,      lowerCAmelCase_	:  int = 0							,      lowerCAmelCase_	:  Optional[List[int]] = None							,      lowerCAmelCase_	:  Optional[List[int]] = None							,      lowerCAmelCase_	:  int = 32							,      lowerCAmelCase_	:  int = 32							,      lowerCAmelCase_	:  int = 2							,      lowerCAmelCase_	:  int = 2							,      lowerCAmelCase_	:  int = 2							,      lowerCAmelCase_	:  int = 2							,      lowerCAmelCase_	:  bool = True							,      lowerCAmelCase_	:  str = "gelu"							,      lowerCAmelCase_	:  int = 64							,      lowerCAmelCase_	:  float = 0.1							,      lowerCAmelCase_	:  float = 0.1							,      lowerCAmelCase_	:  float = 0.1							,      lowerCAmelCase_	:  float = 0.1							,      lowerCAmelCase_	:  float = 0.1							,      lowerCAmelCase_	:  int = 1_00							,      lowerCAmelCase_	:  float = 0.0_2							,      lowerCAmelCase_	:  str=True							,      **lowerCAmelCase_	:  int							,      )      ->							Any:


														"""simple docstring"""


														_a     					=    prediction_length
														_a     					=    context_length or 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 and num_static_categorical_features > 0:
																					if len(lowerCAmelCase_ ) != 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 and num_static_categorical_features > 0:
																					if len(lowerCAmelCase_ ) != 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(lowerCAmelCase_ ) + 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

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







							@property
							def        __lowerCAmelCase      (  self	:  List[Any] )      ->							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
														)







'''simple docstring'''


from dataclasses import dataclass
from enum import Enum
from typing import List, Optional, Union

import numpy as np
import PIL
from PIL import Image

from ...utils import BaseOutput, is_torch_available, is_transformers_available

@dataclass
class       A   (		_a   ):
							lowercase_          =    42
							lowercase_          =    42


if is_transformers_available() and is_torch_available():
				from .pipeline_semantic_stable_diffusion import SemanticStableDiffusionPipeline

