




from typing import List, Optional, Union

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


lowerCAmelCase_						 =					logging.get_logger(__name__)

lowerCAmelCase_						 =					{
    '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 		_A   (    _lowerCamelCase ):
  _UpperCamelCase  :     Tuple					=     '''informer'''
  _UpperCamelCase  :     Any					=     {
      '''hidden_size''': '''d_model''',
      '''num_attention_heads''': '''encoder_attention_heads''',
      '''num_hidden_layers''': '''encoder_layers''',
  }






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






       """simple docstring"""







       lowercase   :  Optional[int]        =					prediction_length
       lowercase   :  List[str]        =					context_length or prediction_length
       lowercase   :  Optional[int]        =					distribution_output
       lowercase   :  List[Any]        =					loss
       lowercase   :  Any        =					input_size
       lowercase   :  List[str]        =					num_time_features
       lowercase   :  Tuple        =					lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
       lowercase   :  Optional[Any]        =					scaling
       lowercase   :  Optional[int]        =					num_dynamic_real_features
       lowercase   :  Tuple        =					num_static_real_features
       lowercase   :  Optional[Any]        =					num_static_categorical_features

       # set cardinality
       if cardinality and num_static_categorical_features > 0:
            if len(_A ) != num_static_categorical_features:
                 raise ValueError(
                     '''The cardinality should be a list of the same length as `num_static_categorical_features`''' )
            lowercase   :  int        =					cardinality
       else:
            lowercase   :  Any        =					[0]

       # set embedding_dimension
       if embedding_dimension and num_static_categorical_features > 0:
            if len(_A ) != num_static_categorical_features:
                 raise ValueError(
                     '''The embedding dimension should be a list of the same length as `num_static_categorical_features`''' )
            lowercase   :  List[Any]        =					embedding_dimension
       else:
            lowercase   :  List[str]        =					[min(50 ,		(cat + 1) // 2 ) for cat in self.cardinality]

       lowercase   :  Optional[Any]        =					num_parallel_samples

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

       lowercase   :  Optional[Any]        =					dropout
       lowercase   :  Dict        =					attention_dropout
       lowercase   :  int        =					activation_dropout
       lowercase   :  Any        =					encoder_layerdrop
       lowercase   :  Optional[Any]        =					decoder_layerdrop

       lowercase   :  Union[str, Any]        =					activation_function
       lowercase   :  Dict        =					init_std

       lowercase   :  Any        =					use_cache

       # Informer
       lowercase   :  int        =					attention_type
       lowercase   :  Optional[int]        =					sampling_factor
       lowercase   :  Any        =					distil

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






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

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


UpperCAmelCase_					=   {"configuration_fnet": ["FNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "FNetConfig"]}

try:
  if not is_sentencepiece_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase_					=   ["FNetTokenizer"]

try:
  if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase_					=   ["FNetTokenizerFast"]

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase_					=   [
      "FNET_PRETRAINED_MODEL_ARCHIVE_LIST",
      "FNetForMaskedLM",
      "FNetForMultipleChoice",
      "FNetForNextSentencePrediction",
      "FNetForPreTraining",
      "FNetForQuestionAnswering",
      "FNetForSequenceClassification",
      "FNetForTokenClassification",
      "FNetLayer",
      "FNetModel",
      "FNetPreTrainedModel",
  ]


if TYPE_CHECKING:
  from .configuration_fnet import FNET_PRETRAINED_CONFIG_ARCHIVE_MAP, FNetConfig

  try:
    if not is_sentencepiece_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_fnet import FNetTokenizer

  try:
    if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_fnet_fast import FNetTokenizerFast

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_fnet import (
        FNET_PRETRAINED_MODEL_ARCHIVE_LIST,
        FNetForMaskedLM,
        FNetForMultipleChoice,
        FNetForNextSentencePrediction,
        FNetForPreTraining,
        FNetForQuestionAnswering,
        FNetForSequenceClassification,
        FNetForTokenClassification,
        FNetLayer,
        FNetModel,
        FNetPreTrainedModel,
    )


else:
  import sys

  UpperCAmelCase_					=   _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)



