docstr: 更新tensor，保留值，取消原有梯度
docstr_tok: ["\u66f4\u65b0tensor\uff0c\u4fdd\u7559\u503c\uff0c\u53d6\u6d88\u539f\u6709\u68af\u5ea6"]
code: def update(self, y_true: torch.Tensor, y_pred: torch.Tensor):
      """
      更新tensor，保留值，取消原有梯度
      """
      y_true = y_true.cpu().detach().numpy()
      y_pred = y_pred.cpu().detach().numpy()
      y_pred = np.argmax(y_pred, axis=-1)
  
      self.y_true = np.append(self.y_true, y_true)
      self.y_pred = np.append(self.y_pred, y_pred)
  
file_path: DeepKE/src/deepke/attribution_extraction/standard/tools/metrics.py
imports: import torch
  import numpy
  from abc import ABCMeta, abstractmethod
  from sklearn.metrics import precision_recall_fscore_support
label_desc: Use image node_id 3 for calling the PRMetric obj's underlying member method code with example usage: obj.update(y_true, y_pred) without return types