code: def __init__(
      self,
      q_len,
      hidden_size,
      n_heads,
      d_k=None,
      d_v=None,
      linear_hidden_size=None,
      norm="BatchNorm",
      attn_dropout=0.0,
      dropout=0.0,
      activation="gelu",
      res_attention=False,
      n_layers=1,
      pre_norm=False,
      store_attn=False,
  ):
      super().__init__()
  
      self.layers = nn.ModuleList(
          [
              TSTEncoderLayer(
                  q_len,
                  hidden_size,
                  n_heads=n_heads,
                  d_k=d_k,
                  d_v=d_v,
                  linear_hidden_size=linear_hidden_size,
                  norm=norm,
                  attn_dropout=attn_dropout,
                  dropout=dropout,
                  activation=activation,
                  res_attention=res_attention,
                  pre_norm=pre_norm,
                  store_attn=store_attn,
              )
              for i in range(n_layers)
          ]
      )
      self.res_attention = res_attention
  
imports: import math
  import numpy
  from typing import Optional
  import torch
  import torch.nn
  import torch.nn.functional
  from ..common._base_windows import BaseWindows
  from ..losses.pytorch import MAE
label_desc: Use image node_id 1 to create a new TSTEncoder object from inherited base classes: nn with example: obj = TSTEncoder(q_len, hidden_size, n_heads, d_k, d_v, linear_hidden_size, norm, attn_dropout, dropout, activation, res_attention, n_layers, pre_norm, store_attn)