code: def __init__(self, args):
      super(GAT, self).__init__()
      self.args = args
  
      missing_keys = list(
          set(
              [
                  "features_num",
                  "num_class",
                  "num_layers",
                  "hidden",
                  "heads",
                  "dropout",
                  "act",
              ]
          )
          - set(self.args.keys())
      )
      if len(missing_keys) > 0:
          raise Exception("Missing keys: %s." % ",".join(missing_keys))
  
      self.num_layer = int(self.args["num_layers"])
      if not self.num_layer == len(self.args["hidden"]) + 1:
          LOGGER.warn(
              "Warning: layer size does not match the length of hidden units"
          )
      self.convs = torch.nn.ModuleList()
  
      self.convs.append(
          GATConv(
              self.args["features_num"],
              self.args["hidden"][0],
              num_heads=self.args["heads"],
              feat_drop=self.args.get(
                  "feat_drop", self.args["dropout"]
              ),
              attn_drop=self.args["dropout"],
          )
      )
      last_dim = self.args["hidden"][0] * self.args["heads"]
      for i in range(self.num_layer - 2):
          self.convs.append(
              GATConv(
                  last_dim,
                  self.args["hidden"][i + 1],
                  num_heads=self.args["heads"],
                  feat_drop=self.args.get(
                      "feat_drop", self.args["dropout"]
                  ),
                  attn_drop=self.args["dropout"],
              )
          )
          last_dim = self.args["hidden"][i + 1] * self.args["heads"]
      self.convs.append(
          GATConv(
              last_dim,
              self.args["num_class"],
              num_heads=1,
              feat_drop=self.args.get(
                  "feat_drop", self.args["dropout"]
              ),
              attn_drop=self.args["dropout"],
          )
      )
  
file_path: AutoGL/autogl/module/model/dgl/gat.py
imports: import torch
  import torch.nn.functional
  from dgl.nn.pytorch.conv import GATConv
  from .None import register_model
  from .base import BaseAutoModel, activate_func
  from ....utils import get_logger
label_desc: Use image node_id 1 to create a new GAT object from inherited base classes: torch.nn with example: obj = GAT(args)