code: def main(args):
      dataset = build_dataset_from_name("hetero-acm-hgt")
      G = dataset[0].to(args.device)
      field = dataset.schema["target_node_type"]
      print(G)
  
      num_features = 256
      labels = G.nodes[field].data["label"].to(args.device)
      num_classes = labels.max().item() + 1
      test_mask = G.nodes[field].data["test_mask"].to(args.device)
      accs = []
  
      for seed in tqdm(range(args.repeat)):
          set_seed(seed)
          if args.model == "hgt":
              model_hp = {
                  # hp from model
                  "num_layers": 2,
                  "hidden": [256, 256, 256],
                  "heads": 4,
                  "dropout": 0.2,
                  "act": "gelu",
                  "use_norm": True,
              }
          elif args.model == "HeteroRGCN":
              model_hp = {
                  # hp from model
                  "num_layers": 2,
                  "hidden": [256],
                  "heads": 4,
                  "dropout": 0.2,
                  "act": "leaky_relu",
              }
  
          trainer = NodeClassificationHetTrainer(
              model=args.model,
              dataset=dataset,
              num_features=num_features,
              num_classes=num_classes,
              device=args.device,
              init=False,
              feval=["acc"],
              loss="cross_entropy",
              optimizer=torch.optim.AdamW,
          ).duplicate_from_hyper_parameter(
              {
                  "trainer": {
                      "max_epoch": args.epoch,
                      "early_stopping_round": args.epoch + 1,
                      "lr": args.max_lr,
                      "weight_decay": args.weight_decay,
                  },
                  "encoder": model_hp,
              }
          )
  
          trainer.train(dataset, False)
          acc = trainer.evaluate(dataset, test_mask, "acc")
          print(acc)
          accs.append(acc)
      print("{:.4f} ~ {:.4f}".format(np.mean(accs), np.std(accs)))
  
file_path: AutoGL/test/performance/heterogeneous/dgl/train_hgt.py
imports: import os
  import numpy
  from tqdm import tqdm
  import torch
  from autogl.module.train import NodeClassificationHetTrainer
  from autogl.solver.utils import set_seed
  import logging
  import argparse
  from autogl.datasets import build_dataset_from_name
label_desc: Use image node_id 2 for calling a global function with example usage: main(args) without return types