code: def train(node_index, node_label, gnn_model, graph, criterion, optim):
      gnn_model.train()
      pred = gnn_model(graph, graph.node_feat["words"])
      pred = paddle.gather(pred, node_index)
      loss = criterion(pred, node_label)
      loss.backward()
      acc = paddle.metric.accuracy(input=pred, label=node_label, k=1)
      optim.step()
      optim.clear_grad()
      return loss, acc
  
file_path: PGL/examples/gatv2/train.py
imports: import tqdm
  import pgl
  import paddle
  import paddle.nn
  from pgl.utils.logger import log
  import numpy
  import time
  import argparse
  from paddle.optimizer import Adam
label_desc: Use image node_id 3 for calling a global function with example usage: train(node_index, node_label, gnn_model, graph, criterion, optim) and returns: loss,  acc