code: def test(model, loader, evaluator, device):
      model.eval()
  
      y_true, y_pred = [], []
      for xs, y in loader:
          xs = [x.to(device) for x in xs]
          y_true.append(y.to(torch.long))
          y_pred.append(model(xs).argmax(dim=-1).cpu())
  
      return evaluator.eval(
          {
              "y_true": torch.cat(y_true, dim=0),
              "y_pred": torch.cat(y_pred, dim=0),
          }
      )["acc"]
  
imports: import time
  import argparse
  import torch
  import numpy
  import torch.nn.functional
  from torch.utils.data import DataLoader
  from torch.nn import ModuleList, Linear, BatchNorm1d, Identity
  from ogb.lsc import MAG240MDataset, MAG240MEvaluator
  from root import ROOT
label_desc: Use image node_id 2 for calling a global function with example usage: test(model, loader, evaluator, device) and returns: evaluator