code: def main(args):
      (
          graph,
          (train_index, val_index, _),
          (train_label, val_label, _),
          feature,
      ) = load_reddit_data()
      row, colptr = get_basic_graph_sample_neighbors_info(
          graph, args.mode
      )
      train_ds = ShardedDataset(train_index, train_label)
      val_ds = ShardedDataset(val_index, val_label)
      train_loader = DataLoader(
          train_ds,
          batch_size=args.batch_size,
          shuffle=True,
          num_workers=0,
          drop_last=False,
      )
      val_loader = DataLoader(
          val_ds,
          batch_size=args.batch_size,
          shuffle=False,
          num_workers=0,
          drop_last=False,
      )
  
      if args.model == "GraphSage":
          gnn_model = GraphSage(
              feature.shape[1], 41, len(args.samples), args.hidden_size
          )
      elif args.model == "GAT":
          gnn_model = GAT(
              feature.shape[1],
              41,
              num_layers=2,
              hidden_size=args.hidden_size,
          )
  
      criterion = paddle.nn.loss.CrossEntropyLoss()
      optim = paddle.optimizer.Adam(
          learning_rate=args.lr,
          parameters=gnn_model.parameters(),
          weight_decay=args.weight_decay,
      )
      feature = paddle.to_tensor(feature)
  
      best_val_acc = 0
      for i in range(args.epochs):
          train_loss, train_acc = train(
              train_loader,
              args.samples,
              row,
              colptr,
              gnn_model,
              feature,
              criterion,
              optim,
              args,
          )
          val_loss, val_acc = eval(
              val_loader,
              args.samples,
              row,
              colptr,
              gnn_model,
              feature,
              criterion,
              args,
          )
          if best_val_acc < val_acc:
              paddle.save(
                  gnn_model.state_dict(),
                  "%s.pdparam" % args.model.lower(),
              )
              best_val_acc = val_acc
          log.info(
              "Epoch :%s, Train loss: %s, Train acc: %s, Val acc: %s"
              % (i, train_loss, train_acc, val_acc)
          )
      log.info("Best val acc: %s" % best_val_acc)
  
file_path: PGL/examples/gnn_depoly/node_classification_with_sampling/train.py
imports: import os
  import sys
  import argparse
  import numpy
  import paddle
  import pgl
  import paddle.nn
  from paddle.io import Dataset, DataLoader
  from pgl.utils.logger import log
  from paddle.optimizer import Adam
  from paddle.framework import core
  from dataset import ShardedDataset
  from models import GraphSage, GAT
label_desc: Use image node_id 6 for calling a global function with example usage: main(args) without return types