code: def layerwise_infer(graph, nid, model, batch_size, device):
      model.eval()
      with torch.no_grad():
          pred = model.module.inference(
              graph, batch_size, device
          )  # pred in buffer_device
          pred = pred[nid]
          label = graph.ndata["label"]
          if isinstance(label, dict):
              label = label["_N"]
          label = label[nid].to(pred.device)
          num_classes = pred.shape[1]
          label = label.squeeze(1)
          return MF.accuracy(
              pred, label, task="multiclass", num_classes=num_classes
          )
  
file_path: cugraph/python/cugraph-dgl/examples/multi_trainer_MG_example/model.py
imports: import time
  import dgl
  import torch
  import torch.nn
  import torch.nn.functional
  import torchmetrics.functional
  from cugraph_dgl.nn import SAGEConv
  import tqdm
label_desc: Use image node_id 1 for calling a global function with example usage: layerwise_infer(graph, nid, model, batch_size, device) and returns: MF