def METHOD_NAME(data_loader, samples, row, colptr, model, feature, criterion, optim,
          args):
    model.METHOD_NAME()
    total_loss = total_acc = 0
    total_sample = 0
    batch = 0
    for node_index, node_label in data_loader:
        batch += 1
        edge_index, n_id = get_sample_graph_list(row, colptr, node_index,
                                                 samples)
        if args.model == "GraphSage":
            pred = model(edge_index, feature[n_id])[:node_index.shape[0]]
        elif args.model == "GAT":
            pred = model(edge_index, n_id.shape[0],
                         feature[n_id])[:node_index.shape[0]]
        else:
            raise ValueError("Not supported model!")
        loss = criterion(pred, node_label)
        acc = paddle.metric.accuracy(
            input=pred, label=node_label.reshape([-1, 1]), k=1)
        total_acc += acc.numpy() * node_index.shape[0]
        loss.backward()
        optim.step()
        optim.clear_grad()
        total_loss += float(loss) * node_index.shape[0]
        total_sample += node_index.shape[0]
    return total_loss / total_sample, total_acc / total_sample