code: def get_sample_weights(
      self, X, time_perf, time_belong, ignore_weight=False
  ):
      weights = (
          torch.from_numpy(np.ones(X.shape[0])).float().to(X.device)
      )
      if not ignore_weight:
          if time_perf is not None:
              weights_t = self.twm(time_perf, time_belong)
              weights = weights * weights_t
      return 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 PredNet obj's underlying member method code with example usage: obj.get_sample_weights(X, time_perf, time_belong, ignore_weight) and returns: weights