code: def __init__(
      self,
      c_in,
      patch_num,
      patch_len,
      max_seq_len=1024,
      n_layers=3,
      hidden_size=128,
      n_heads=16,
      d_k=None,
      d_v=None,
      linear_hidden_size=256,
      norm="BatchNorm",
      attn_dropout=0.0,
      dropout=0.0,
      act="gelu",
      store_attn=False,
      key_padding_mask="auto",
      padding_var=None,
      attn_mask=None,
      res_attention=True,
      pre_norm=False,
      pe="zeros",
      learn_pe=True,
  ):
      super().__init__()
  
      self.patch_num = patch_num
      self.patch_len = patch_len
  
      # Input encoding
      q_len = patch_num
      self.W_P = nn.Linear(
          patch_len, hidden_size
      )  # Eq 1: projection of feature vectors onto a d-dim vector space
      self.seq_len = q_len
  
      # Positional encoding
      self.W_pos = positional_encoding(pe, learn_pe, q_len, hidden_size)
  
      # Residual dropout
      self.dropout = nn.Dropout(dropout)
  
      # Encoder
      self.encoder = TSTEncoder(
          q_len,
          hidden_size,
          n_heads,
          d_k=d_k,
          d_v=d_v,
          linear_hidden_size=linear_hidden_size,
          norm=norm,
          attn_dropout=attn_dropout,
          dropout=dropout,
          pre_norm=pre_norm,
          activation=act,
          res_attention=res_attention,
          n_layers=n_layers,
          store_attn=store_attn,
      )
  
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 TSTiEncoder object from inherited base classes: nn with example: obj = TSTiEncoder(c_in, patch_num, patch_len, max_seq_len, n_layers, hidden_size, n_heads, d_k, d_v, linear_hidden_size, norm, attn_dropout, dropout, act, store_attn, key_padding_mask, padding_var, attn_mask, res_attention, pre_norm, pe, learn_pe)