code: def model_test(model, embeds):
      model.eval()
      with torch.no_grad():
          output = model(embeds)
          pred = output.argmax(dim=-1)
          test_mask, tv_mask = model.test_mask, model.tv_mask
          loss_tv = F.mse_loss(
              output[tv_mask], model.label_one_hot[tv_mask]
          )
      accs = []
      for mask in [tv_mask, test_mask]:
          accs.append(
              float(
                  (pred[mask] == model.label[mask]).sum() / mask.sum()
              )
          )
      return loss_tv.item(), accs[0], accs[1], pred
  
file_path: dgl/examples/pytorch/ogc/utils.py
imports: import dgl.sparse
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 2 for calling a global function with example usage: model_test(model, embeds) and returns: loss_tv,  accs,  accs,  pred