code: def eval(dataloader, model, feature, criterion):
      model.eval()
      loss_all, acc_all = [], []
      for g, sample_index, index, label in dataloader:
          g.tensor()
          sample_index = paddle.to_tensor(sample_index)
          index = paddle.to_tensor(index)
          label = paddle.to_tensor(label)
  
          feat = paddle.gather(feature, sample_index)
          pred = model(g, feat)
          pred = paddle.gather(pred, index)
          loss = criterion(pred, label)
          acc = paddle.metric.accuracy(input=pred, label=label, k=1)
          loss_all.append(loss.numpy())
          acc_all.append(acc.numpy())
  
      return np.mean(loss_all), np.mean(acc_all)
  
file_path: PGL/examples/graphsage/cpu_sample_version/train.py
imports: import os
  import argparse
  import time
  from functools import partial
  import numpy
  import tqdm
  import pgl
  import paddle
  from pgl.utils.logger import log
  from pgl.utils.data import Dataloader
  from model import GraphSage
  from dataset import ShardedDataset, batch_fn
label_desc: Use image node_id 2 for calling a global function with example usage: eval(dataloader, model, feature, criterion) and returns: np,  np