code: def compute_acc(logits, label, reduction="mean"):
      ret = (torch.argmax(logits, dim=1) == label).float()
      if reduction == "none":
          return ret.detach()
      elif reduction == "mean":
          return ret.mean().item()
  
imports: import math
  import numpy
  import io
  import os
  import time
  from collections import defaultdict, deque
  import datetime
  import torch
  import torch.distributed
label_desc: Use image node_id 4 for calling a global function with example usage: compute_acc(logits, label, reduction) and returns: ret, ret