code: def compute_acc(logits, y, mask):
      """Compute accuracy for train/validation/test dataset.
  
      Args:
  
          logits (paddle.Tensor): logits returned from gnn models.
  
          y (numpy.ndarray): Labels of data samples.
  
          mask (numpy.ndarray): Mask of data samples for different datasets.
  
      Returns:
  
          acc (float): Return the accuracy of input examples.
  
      """
      logits = logits.numpy()
      if mask is not None:
          true_index = np.nonzero(mask)[0]
          logits = logits[true_index]
          y = y[true_index].reshape([-1])
          acc = float(
              np.equal(np.argmax(logits, axis=-1), y).sum()
          ) / len(true_index)
      return acc
  
file_path: PGL/apps/GNNAutoScale/utils.py
imports: import time
  import functools
  import numpy
  import paddle
  import pgl
  from pgl.utils.logger import log
label_desc: Use image node_id 6 for calling a global function with example usage: compute_acc(logits, y, mask) and returns: acc