




from typing import List, Optional, Union

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


_lowerCamelCase     :		int								=       logging.get_logger(__name__)

_lowerCamelCase     :		List[str]								=       {
    """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_   (			UpperCAmelCase__					):

    '''simple docstring'''






    UpperCAmelCase__							  =				'''informer'''
    UpperCAmelCase__							  =				{
        '''hidden_size''': '''d_model''',
        '''num_attention_heads''': '''encoder_attention_heads''',
        '''num_hidden_layers''': '''encoder_layers''',
    }


    def __init__(      self				:     str ,			UpperCAmelCase__				:     Optional[int] = None ,			UpperCAmelCase__				:     Optional[int] = None ,			UpperCAmelCase__				:     str = "student_t" ,			UpperCAmelCase__				:     str = "nll" ,			UpperCAmelCase__				:     int = 1 ,			UpperCAmelCase__				:     List[int] = None ,			UpperCAmelCase__				:     Optional[Union[str, bool]] = "mean" ,			UpperCAmelCase__				:     int = 0 ,			UpperCAmelCase__				:     int = 0 ,			UpperCAmelCase__				:     int = 0 ,			UpperCAmelCase__				:     int = 0 ,			UpperCAmelCase__				:     Optional[List[int]] = None ,			UpperCAmelCase__				:     Optional[List[int]] = None ,			UpperCAmelCase__				:     int = 64 ,			UpperCAmelCase__				:     int = 32 ,			UpperCAmelCase__				:     int = 32 ,			UpperCAmelCase__				:     int = 2 ,			UpperCAmelCase__				:     int = 2 ,			UpperCAmelCase__				:     int = 2 ,			UpperCAmelCase__				:     int = 2 ,			UpperCAmelCase__				:     bool = True ,			UpperCAmelCase__				:     str = "gelu" ,			UpperCAmelCase__				:     float = 0.05 ,			UpperCAmelCase__				:     float = 0.1 ,			UpperCAmelCase__				:     float = 0.1 ,			UpperCAmelCase__				:     float = 0.1 ,			UpperCAmelCase__				:     float = 0.1 ,			UpperCAmelCase__				:     int = 100 ,			UpperCAmelCase__				:     float = 0.02 ,			UpperCAmelCase__				:     List[str]=True ,			UpperCAmelCase__				:     str = "prob" ,			UpperCAmelCase__				:     int = 5 ,			UpperCAmelCase__				:     bool = True ,			**UpperCAmelCase__				:     Tuple ,			)						->List[str]:





           '''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 if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
           A__							=   scaling
           A__							=   num_dynamic_real_features
           A__							=   num_static_real_features
           A__							=   num_static_categorical_features

           # set cardinality
           if cardinality and num_static_categorical_features > 0:
                  if len(UpperCAmelCase__) != 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]

           # set embedding_dimension
           if embedding_dimension and num_static_categorical_features > 0:
                  if len(UpperCAmelCase__) != 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

           # Informer
           A__							=   attention_type
           A__							=   sampling_factor
           A__							=   distil

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





    @property
    def 	SCREAMING_SNAKE_CASE							(      self				:     Dict)						->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 typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


_lowerCamelCase     :		Union[str, Any]								=       {
    """configuration_swiftformer""": [
        """SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """SwiftFormerConfig""",
        """SwiftFormerOnnxConfig""",
    ]
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _lowerCamelCase     :		Union[str, Any]								=       [
      """SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """SwiftFormerForImageClassification""",
      """SwiftFormerModel""",
      """SwiftFormerPreTrainedModel""",
  ]

if TYPE_CHECKING:
  from .configuration_swiftformer import (
      SWIFTFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
      SwiftFormerConfig,
      SwiftFormerOnnxConfig,
  )

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_swiftformer import (
        SWIFTFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
        SwiftFormerForImageClassification,
        SwiftFormerModel,
        SwiftFormerPreTrainedModel,
    )

else:
  import sys

  _lowerCamelCase     :		str								=       _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)


