code: def train(model, G):
      best_val_acc = torch.tensor(0)
      train_step = torch.tensor(0)
      for epoch in np.arange(args.n_epoch) + 1:
          model.train()
          logits = model(G, "paper")
          # The loss is computed only for labeled nodes.
          loss = F.cross_entropy(
              logits[train_idx], labels[train_idx].to(args.device)
          )
          optimizer.zero_grad()
          loss.backward()
          torch.nn.utils.clip_grad_norm_(model.parameters(), args.clip)
          optimizer.step()
          train_step += 1
          scheduler.step(train_step)
  
file_path: AutoGL/test/performance/heterogeneous/dgl/hgt_base/base.py
imports: import scipy.io
  import urllib.request
  import dgl
  import math
  import numpy
  from model import *
  import argparse
  from tqdm import tqdm
label_desc: Use image node_id 3 for calling a global function with example usage: train(model, G) without return types