code: def main(args):
      dataset = build_dataset_from_name("hetero-acm-han")
      node_type = dataset.schema["target_node_type"]
      g = dataset[0].to(args["device"])
  
      labels = g.nodes[node_type].data["label"]
      num_classes = labels.max().item() + 1
  
      labels = labels.to(args["device"])
      train_mask = (
          g.nodes[node_type].data["train_mask"].to(args["device"])
      )
      val_mask = g.nodes[node_type].data["val_mask"].to(args["device"])
      test_mask = (
          g.nodes[node_type].data["test_mask"].to(args["device"])
      )
  
      model = AutoHAN(
          dataset=dataset,
          num_features=g.nodes[node_type].data["feat"].shape[1],
          num_classes=num_classes,
          device=args["device"],
          init=True,
      ).model
      g = g.to(args["device"])
  
      stopper = EarlyStopping(patience=args["patience"])
      loss_fcn = torch.nn.CrossEntropyLoss()
      optimizer = torch.optim.Adam(
          model.parameters(),
          lr=args["lr"],
          weight_decay=args["weight_decay"],
      )
  
      for epoch in range(args["num_epochs"]):
          model.train()
          logits = model(g)
          loss = loss_fcn(logits[train_mask], labels[train_mask])
  
          optimizer.zero_grad()
          loss.backward()
          optimizer.step()
  
          val_loss, val_acc, _, _ = evaluate(
              model, g, labels, val_mask, loss_fcn
          )
          early_stop = stopper.step(
              val_loss.data.item(), val_acc, model
          )
  
          if early_stop:
              break
  
      stopper.load_checkpoint(model)
      _, test_acc, _, _ = evaluate(
          model, g, labels, test_mask, loss_fcn
      )
  
      return test_acc
  
file_path: AutoGL/test/performance/heterogeneous/dgl/han_main.py
imports: import os
  import numpy
  from tqdm import tqdm
  import torch
  from autogl.module.model.dgl import AutoHAN
  from helper import EarlyStopping
  import argparse
  import random
  from sklearn.metrics import f1_score
  from autogl.datasets import build_dataset_from_name
label_desc: Use image node_id 5 for calling a global function with example usage: main(args) and returns: test_acc