code: def forward(self, time_perf, time_belong=None, return_preds=False):
      hist_step_n = self.linear.in_features
      # NOTE: the reshape order is very important
      time_perf = time_perf.reshape(
          hist_step_n,
          time_perf.shape[0] // hist_step_n,
          *time_perf.shape[1:],
      )
      time_perf = torch.mean(time_perf, dim=1, keepdim=False)
  
      preds = []
      for i in range(time_perf.shape[1]):
          preds.append(self.linear(time_perf[:, i]))
      preds = torch.cat(preds)
      preds = preds - torch.mean(
          preds
      )  # avoid using future information
      preds = preds * self.k
      if return_preds:
          if time_belong is None:
              return preds
          else:
              return time_belong @ preds
      else:
          weights = preds_to_weight_with_clamp(
              preds, self.clip_weight, self.clip_method
          )
          if time_belong is None:
              return weights
          else:
              return time_belong @ weights
  
file_path: qlib/qlib/contrib/meta/data_selection/net.py
imports: import numpy
  import torch
  from torch import nn
  from .utils import preds_to_weight_with_clamp, SingleMetaBase
label_desc: Use image node_id 2 for calling the TimeWeightMeta obj's underlying member method code with example usage: obj.forward(time_perf, time_belong, return_preds) and returns: preds, unknown, weights, unknown