code: def compute(self):
      h = self.mat.float()
      # 计算全局预测准确率(混淆矩阵的对角线为预测正确的个数)
      acc_global = torch.diag(h).sum() / h.sum()
      # 计算每个类别的准确率
      acc = torch.diag(h) / h.sum(1)
      # 计算每个类别预测与真实目标的iou
      iu = torch.diag(h) / (h.sum(1) + h.sum(0) - torch.diag(h))
      return acc_global, acc, iu
  
imports: from collections import defaultdict, deque
  import datetime
  import time
  import torch
  import torch.nn.functional
  import torch.distributed
  import errno
  import os
  from .dice_coefficient_loss import multiclass_dice_coeff, build_target
label_desc: Use image node_id 4 for calling the ConfusionMatrix obj's underlying member method code with example usage: obj.compute() and returns: acc_global,  acc,  iu