class_docstr: Autoformer is the first method to achieve the series-wise connection,
  with inherent O(LlogL) complexity
class_docstr_tok: ["Autoformer","is","the","first","method","to","achieve","the","series-wise","connection",",","with","inherent","O","(","LlogL",")","complexity"]
code: def forward(
      self,
      x_enc,
      x_mark_enc,
      x_dec,
      x_mark_dec,
      enc_self_mask=None,
      dec_self_mask=None,
      dec_enc_mask=None,
  ):
      # decomp init
      mean = (
          torch.mean(x_enc, dim=1)
          .unsqueeze(1)
          .repeat(1, self.pred_len, 1)
      )
      zeros = torch.zeros(
          [x_enc.shape[0], self.pred_len, x_enc.shape[2]],
          device=x_enc.device,
      )
      seasonal_init, trend_init = self.decomp(x_enc)
      # decoder input
      trend_init = torch.cat(
          [trend_init[:, -self.label_len :, :], mean], dim=1
      )
      seasonal_init = torch.cat(
          [seasonal_init[:, -self.label_len :, :], zeros], dim=1
      )
      # enc
      enc_out = self.enc_embedding(x_enc, x_mark_enc)
      enc_out, attns = self.encoder(enc_out, attn_mask=enc_self_mask)
      # dec
      dec_out = self.dec_embedding(seasonal_init, x_mark_dec)
      seasonal_part, trend_part = self.decoder(
          dec_out,
          enc_out,
          x_mask=dec_self_mask,
          cross_mask=dec_enc_mask,
          trend=trend_init,
      )
      # final
      dec_out = trend_part + seasonal_part
  
      if self.output_attention:
          return dec_out[:, -self.pred_len :, :], attns
      else:
          return dec_out[:, -self.pred_len :, :]
  
file_path: BigDL/python/chronos/src/bigdl/chronos/model/autoformer/Autoformer.py
imports: import torch
  import torch.nn
  from .layers.Embed import DataEmbedding_wo_pos
  from .layers.AutoCorrelation import AutoCorrelation, AutoCorrelationLayer
  from .layers.Autoformer_EncDec import Encoder, Decoder, EncoderLayer, DecoderLayer, my_Layernorm, series_decomp
  import torch.optim
  import pytorch_lightning
  from collections import namedtuple
  from ..utils import PYTORCH_REGRESSION_LOSS_MAP
label_desc: Use image node_id 2 for calling the AutoFormer obj's underlying member method code with example usage: obj.forward(x_enc, x_mark_enc, x_dec, x_mark_dec, enc__mask, dec__mask, dec_enc_mask) and returns: dec_out,  attns, dec_out