
from . import (
    albert,
    align,
    altclip,
    audio_spectrogram_transformer,
    auto,
    autoformer,
    bark,
    bart,
    barthez,
    bartpho,
    beit,
    bert,
    bert_generation,
    bert_japanese,
    bertweet,
    big_bird,
    bigbird_pegasus,
    biogpt,
    bit,
    blenderbot,
    blenderbot_small,
    blip,
    blip_a,
    bloom,
    bridgetower,
    byta,
    camembert,
    canine,
    chinese_clip,
    clap,
    clip,
    clipseg,
    codegen,
    conditional_detr,
    convbert,
    convnext,
    convnextva,
    cpm,
    cpmant,
    ctrl,
    cvt,
    dataavec,
    deberta,
    deberta_va,
    decision_transformer,
    deformable_detr,
    deit,
    deprecated,
    deta,
    detr,
    dialogpt,
    dinat,
    distilbert,
    dit,
    donut,
    dpr,
    dpt,
    efficientformer,
    efficientnet,
    electra,
    encodec,
    encoder_decoder,
    ernie,
    ernie_m,
    esm,
    falcon,
    flaubert,
    flava,
    fnet,
    focalnet,
    fsmt,
    funnel,
    git,
    glpn,
    gpta,
    gpt_bigcode,
    gpt_neo,
    gpt_neox,
    gpt_neox_japanese,
    gpt_swa,
    gptj,
    gptsan_japanese,
    graphormer,
    groupvit,
    herbert,
    hubert,
    ibert,
    imagegpt,
    informer,
    instructblip,
    jukebox,
    layoutlm,
    layoutlmva,
    layoutlmva,
    layoutxlm,
    led,
    levit,
    lilt,
    llama,
    longformer,
    longta,
    luke,
    lxmert,
    mam_aaa,
    marian,
    markuplm,
    maskaformer,
    maskformer,
    mbart,
    mbartaa,
    mega,
    megatron_bert,
    megatron_gpta,
    mgp_str,
    mluke,
    mobilebert,
    mobilenet_va,
    mobilenet_va,
    mobilevit,
    mobilevitva,
    mpnet,
    mra,
    mta,
    musicgen,
    mvp,
    nat,
    nezha,
    nllb,
    nllb_moe,
    nystromformer,
    oneformer,
    open_llama,
    openai,
    opt,
    owlvit,
    pegasus,
    pegasus_x,
    perceiver,
    phobert,
    pixastruct,
    plbart,
    poolformer,
    prophetnet,
    qdqbert,
    rag,
    realm,
    reformer,
    regnet,
    rembert,
    resnet,
    roberta,
    roberta_prelayernorm,
    roc_bert,
    roformer,
    rwkv,
    sam,
    segformer,
    sew,
    sew_d,
    speech_encoder_decoder,
    speech_to_text,
    speech_to_text_a,
    speechta,
    splinter,
    squeezebert,
    swiftformer,
    swin,
    swinasr,
    swinva,
    switch_transformers,
    ta,
    table_transformer,
    tapas,
    time_series_transformer,
    timesformer,
    timm_backbone,
    transfo_xl,
    trocr,
    tvlt,
    umta,
    unispeech,
    unispeech_sat,
    upernet,
    videomae,
    vilt,
    vision_encoder_decoder,
    vision_text_dual_encoder,
    visual_bert,
    vit,
    vit_hybrid,
    vit_mae,
    vit_msn,
    vivit,
    wavaveca,
    wavaveca_conformer,
    wavaveca_phoneme,
    wavaveca_with_lm,
    wavlm,
    whisper,
    x_clip,
    xglm,
    xlm,
    xlm_prophetnet,
    xlm_roberta,
    xlm_roberta_xl,
    xlnet,
    xmod,
    yolos,
    yoso,
)









'''simple docstring'''


from typing import List, Optional

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


lowerCAmelCase					:     Optional[int]												=logging.get_logger(__name__)

lowerCAmelCase					:     Tuple												={
    '''huggingface/autoformer-tourism-monthly''': '''https://huggingface.co/huggingface/autoformer-tourism-monthly/resolve/main/config.json''',
}
class       a_   (				_lowerCAmelCase							):
     __A      =			"autoformer"
     __A      =			{
         "hidden_size": "d_model",
         "num_attention_heads": "encoder_attention_heads",
         "num_hidden_layers": "encoder_layers",
     }





     def __init__( self		:					Any	,      lowercase		:					Optional[int] = None	,      lowercase		:					Optional[int] = None	,      lowercase		:					str = "student_t"	,      lowercase		:					str = "nll"	,      lowercase		:					int = 1	,      lowercase		:					List[int] = [1, 2, 3, 4, 5, 6, 7]	,      lowercase		:					bool = True	,      lowercase		:					int = 0	,      lowercase		:					int = 0	,      lowercase		:					int = 0	,      lowercase		:					int = 0	,      lowercase		:					Optional[List[int]] = None	,      lowercase		:					Optional[List[int]] = None	,      lowercase		:					int = 64	,      lowercase		:					int = 2	,      lowercase		:					int = 2	,      lowercase		:					int = 2	,      lowercase		:					int = 2	,      lowercase		:					int = 32	,      lowercase		:					int = 32	,      lowercase		:					str = "gelu"	,      lowercase		:					float = 0.1	,      lowercase		:					float = 0.1	,      lowercase		:					float = 0.1	,      lowercase		:					float = 0.1	,      lowercase		:					float = 0.1	,      lowercase		:					int = 100	,      lowercase		:					float = 0.02	,      lowercase		:					bool = True	,      lowercase		:					int=True	,      lowercase		:					int = 10	,      lowercase		:					int = 25	,      lowercase		:					int = 3	,      **lowercase		:					Dict	,      ):





        """simple docstring"""




        lowercase_			:str    			= prediction_length
        lowercase_			:Dict    			= context_length if context_length is not None else prediction_length
        lowercase_			:Any    			= distribution_output
        lowercase_			:Tuple    			= loss
        lowercase_			:Dict    			= input_size
        lowercase_			:Tuple    			= num_time_features
        lowercase_			:int    			= lags_sequence
        lowercase_			:Tuple    			= scaling
        lowercase_			:List[Any]    			= num_dynamic_real_features
        lowercase_			:Union[str, Any]    			= num_static_real_features
        lowercase_			:str    			= 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`"						)
           lowercase_			:Optional[int]    			= cardinality
        else:
           lowercase_			:Optional[int]    			= [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`"						)
           lowercase_			:Tuple    			= embedding_dimension
        else:
           lowercase_			:Dict    			= [min(50	,      (cat + 1) // 2						) for cat in self.cardinality]
        lowercase_			:Any    			= num_parallel_samples

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

        lowercase_			:Dict    			= dropout
        lowercase_			:Dict    			= attention_dropout
        lowercase_			:str    			= activation_dropout
        lowercase_			:int    			= encoder_layerdrop
        lowercase_			:Dict    			= decoder_layerdrop

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

        lowercase_			:Optional[int]    			= use_cache

        # Autoformer
        lowercase_			:List[str]    			= label_length
        lowercase_			:List[str]    			= moving_average
        lowercase_			:Optional[int]    			= autocorrelation_factor

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







     @property
     def 							lowercase__      ( self		:					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
        )


