'''simple docstring'''




from typing import List, Optional, Union

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


_A								=   logging.get_logger(__name__)

_A								=   {
    """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			):






   """simple docstring"""
   A							:       Optional[Any]     =    "informer"
   A							:       Union[str, Any]     =    {
       "hidden_size": "d_model",
       "num_attention_heads": "encoder_attention_heads",
       "num_hidden_layers": "encoder_layers",
   }
   def __init__(self       ,				_a = None       ,				_a = None       ,				_a = "student_t"       ,				_a = "nll"       ,				_a = 1       ,				_a = None       ,				_a = "mean"       ,				_a = 0       ,				_a = 0       ,				_a = 0       ,				_a = 0       ,				_a = None       ,				_a = None       ,				_a = 64       ,				_a = 32       ,				_a = 32       ,				_a = 2       ,				_a = 2       ,				_a = 2       ,				_a = 2       ,				_a = True       ,				_a = "gelu"       ,				_a = 0.05       ,				_a = 0.1       ,				_a = 0.1       ,				_a = 0.1       ,				_a = 0.1       ,				_a = 100       ,				_a = 0.02       ,				_a=True       ,				_a = "prob"       ,				_a = 5       ,				_a = True       ,				**_a       ,				)    ->     str:
        lowercase_					:       Any     				=					prediction_length
        lowercase_					:       Optional[int]     				=					context_length or prediction_length
        lowercase_					:       Dict     				=					distribution_output
        lowercase_					:       Optional[int]     				=					loss
        lowercase_					:       List[str]     				=					input_size
        lowercase_					:       Optional[Any]     				=					num_time_features
        lowercase_					:       int     				=					lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
        lowercase_					:       List[Any]     				=					scaling
        lowercase_					:       Union[str, Any]     				=					num_dynamic_real_features
        lowercase_					:       Union[str, Any]     				=					num_static_real_features
        lowercase_					:       List[Any]     				=					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`'				)
             lowercase_					:       List[str]     				=					cardinality
        else:
             lowercase_					:       List[str]     				=					[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`'				)
             lowercase_					:       int     				=					embedding_dimension
        else:
             lowercase_					:       Optional[Any]     				=					[min(50       ,				(cat + 1) // 2				) for cat in self.cardinality]

        lowercase_					:       Dict     				=					num_parallel_samples

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

        lowercase_					:       Tuple     				=					dropout
        lowercase_					:       str     				=					attention_dropout
        lowercase_					:       Optional[int]     				=					activation_dropout
        lowercase_					:       Dict     				=					encoder_layerdrop
        lowercase_					:       str     				=					decoder_layerdrop

        lowercase_					:       str     				=					activation_function
        lowercase_					:       List[str]     				=					init_std

        lowercase_					:       int     				=					use_cache

        # Informer
        lowercase_					:       Union[str, Any]     				=					attention_type
        lowercase_					:       List[str]     				=					sampling_factor
        lowercase_					:       List[str]     				=					distil

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





   @property
   def 		_lowerCamelCase (self				)    ->     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'''




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_A								=   {
    'configuration_bigbird_pegasus': [
        'BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'BigBirdPegasusConfig',
        'BigBirdPegasusOnnxConfig',
    ],
}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _A								=   [
     'BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST',
     'BigBirdPegasusForCausalLM',
     'BigBirdPegasusForConditionalGeneration',
     'BigBirdPegasusForQuestionAnswering',
     'BigBirdPegasusForSequenceClassification',
     'BigBirdPegasusModel',
     'BigBirdPegasusPreTrainedModel',
 ]


if TYPE_CHECKING:
 from .configuration_bigbird_pegasus import (
     BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP,
     BigBirdPegasusConfig,
     BigBirdPegasusOnnxConfig,
 )

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_bigbird_pegasus import (
      BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST,
      BigBirdPegasusForCausalLM,
      BigBirdPegasusForConditionalGeneration,
      BigBirdPegasusForQuestionAnswering,
      BigBirdPegasusForSequenceClassification,
      BigBirdPegasusModel,
      BigBirdPegasusPreTrainedModel,
  )


else:
 import sys

 _A								=   _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)




