

from typing import List, Optional

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


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

_lowerCamelCase      :					str					    =      {
    '''huggingface/autoformer-tourism-monthly''': '''https://huggingface.co/huggingface/autoformer-tourism-monthly/resolve/main/config.json''',
}





class        lowerCAmelCase__  (					__magic_name__			):



       '''simple docstring'''







       lowercase_						=    """autoformer"""
       lowercase_						=    {
           """hidden_size""": """d_model""",
           """num_attention_heads""": """encoder_attention_heads""",
           """num_hidden_layers""": """encoder_layers""",
       }

       def __init__(							self ,   lowercase__ = None ,   lowercase__ = None ,   lowercase__ = "student_t" ,   lowercase__ = "nll" ,   lowercase__ = 1 ,   lowercase__ = [1, 2, 3, 4, 5, 6, 7] ,   lowercase__ = True ,   lowercase__ = 0 ,   lowercase__ = 0 ,   lowercase__ = 0 ,   lowercase__ = 0 ,   lowercase__ = None ,   lowercase__ = None ,   lowercase__ = 6_4 ,   lowercase__ = 2 ,   lowercase__ = 2 ,   lowercase__ = 2 ,   lowercase__ = 2 ,   lowercase__ = 3_2 ,   lowercase__ = 3_2 ,   lowercase__ = "gelu" ,   lowercase__ = 0.1 ,   lowercase__ = 0.1 ,   lowercase__ = 0.1 ,   lowercase__ = 0.1 ,   lowercase__ = 0.1 ,   lowercase__ = 1_0_0 ,   lowercase__ = 0.02 ,   lowercase__ = True ,   lowercase__=True ,   lowercase__ = 1_0 ,   lowercase__ = 2_5 ,   lowercase__ = 3 ,   **lowercase__ ,   ):







             '''simple docstring'''



             __A    =prediction_length
             __A    =context_length if context_length is not None else 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 is not None and num_static_categorical_features > 0:
                   if len(lowercase__     ) != 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 is not None and num_static_categorical_features > 0:
                   if len(lowercase__     ) != 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(5_0 ,   (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

             # Autoformer
             __A    =label_length
             __A    =moving_average
             __A    =autocorrelation_factor

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


       @property
       def     __UpperCamelCase     (							self     ):







             '''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_tokenizers_available, is_torch_available


_lowerCamelCase      :					Tuple					    =      {
    '''configuration_squeezebert''': [
        '''SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''SqueezeBertConfig''',
        '''SqueezeBertOnnxConfig''',
    ],
    '''tokenization_squeezebert''': ['''SqueezeBertTokenizer'''],
}

try:
   if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _lowerCamelCase      :					List[str]					    =      ['''SqueezeBertTokenizerFast''']

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _lowerCamelCase      :					Tuple					    =      [
       '''SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST''',
       '''SqueezeBertForMaskedLM''',
       '''SqueezeBertForMultipleChoice''',
       '''SqueezeBertForQuestionAnswering''',
       '''SqueezeBertForSequenceClassification''',
       '''SqueezeBertForTokenClassification''',
       '''SqueezeBertModel''',
       '''SqueezeBertModule''',
       '''SqueezeBertPreTrainedModel''',
   ]


if TYPE_CHECKING:
   from .configuration_squeezebert import (
       SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP,
       SqueezeBertConfig,
       SqueezeBertOnnxConfig,
   )
   from .tokenization_squeezebert import SqueezeBertTokenizer

   try:
      if not is_tokenizers_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .tokenization_squeezebert_fast import SqueezeBertTokenizerFast

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_squeezebert import (
          SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
          SqueezeBertForMaskedLM,
          SqueezeBertForMultipleChoice,
          SqueezeBertForQuestionAnswering,
          SqueezeBertForSequenceClassification,
          SqueezeBertForTokenClassification,
          SqueezeBertModel,
          SqueezeBertModule,
          SqueezeBertPreTrainedModel,
      )

else:
   import sys

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


