code: def __init__(
      self,
      in_feats,
      out_feats,
      num_heads=8,
      feat_drop=0.0,
      attn_drop=0.0,
      negative_slope=0.2,
      residual=True,
      activation=F.elu,
      k=8,
  ):
      super(HardGAO, self).__init__()
      self.num_heads = num_heads
      self.in_feats = in_feats
      self.out_feats = out_feats
      self.k = k
      self.residual = residual
      # Initialize Parameters for Additive Attention
      self.fc = nn.Linear(
          self.in_feats, self.out_feats * self.num_heads, bias=False
      )
      self.attn_l = nn.Parameter(
          torch.FloatTensor(size=(1, self.num_heads, self.out_feats))
      )
      self.attn_r = nn.Parameter(
          torch.FloatTensor(size=(1, self.num_heads, self.out_feats))
      )
      # Initialize Parameters for Hard Projection
      self.p = nn.Parameter(torch.FloatTensor(size=(1, in_feats)))
      # Initialize Dropouts
      self.feat_drop = nn.Dropout(feat_drop)
      self.attn_drop = nn.Dropout(attn_drop)
      self.leaky_relu = nn.LeakyReLU(negative_slope)
      if self.residual:
          if self.in_feats == self.out_feats:
              self.residual_module = Identity()
          else:
              self.residual_module = nn.Linear(
                  self.in_feats, self.out_feats * num_heads, bias=False
              )
  
      self.reset_parameters()
      self.activation = activation
  
file_path: dgl/examples/pytorch/hardgat/hgao.py
imports: from functools import partial
  import dgl
  import dgl.function
  import torch
  import torch.nn
  import torch.nn.functional
  from dgl.base import DGLError
  from dgl.nn.pytorch import edge_softmax
  from dgl.nn.pytorch.utils import Identity
  from dgl.sampling import select_topk
label_desc: Use image node_id 1 to create a new HardGAO object from inherited base classes: nn with example: obj = HardGAO(in_feats, out_feats, num_heads, feat_drop, attn_drop, negative_slope, residual, activation, k)