code: def forward(self, G, h):
      with G.local_scope():
          node_dict, edge_dict = self.node_dict, self.edge_dict
          for srctype, etype, dsttype in G.canonical_etypes:
              sub_graph = G[srctype, etype, dsttype]
  
              k_linear = self.k_linears[node_dict[srctype]]
              v_linear = self.v_linears[node_dict[srctype]]
              q_linear = self.q_linears[node_dict[dsttype]]
  
              k = k_linear(h[srctype]).view(-1, self.n_heads, self.d_k)
              v = v_linear(h[srctype]).view(-1, self.n_heads, self.d_k)
              q = q_linear(h[dsttype]).view(-1, self.n_heads, self.d_k)
  
              e_id = self.edge_dict[etype]
  
              relation_att = self.relation_att[e_id]
              relation_pri = self.relation_pri[e_id]
              relation_msg = self.relation_msg[e_id]
  
              k = torch.einsum("bij,ijk->bik", k, relation_att)
              v = torch.einsum("bij,ijk->bik", v, relation_msg)
  
              sub_graph.srcdata["k"] = k
              sub_graph.dstdata["q"] = q
              sub_graph.srcdata["v_%d" % e_id] = v
  
              sub_graph.apply_edges(fn.v_dot_u("q", "k", "t"))
              attn_score = (
                  sub_graph.edata.pop("t").sum(-1)
                  * relation_pri
                  / self.sqrt_dk
              )
              attn_score = edge_softmax(
                  sub_graph, attn_score, norm_by="dst"
              )
  
              sub_graph.edata["t"] = attn_score.unsqueeze(-1)
  
          G.multi_update_all(
              {
                  etype: (
                      fn.u_mul_e("v_%d" % e_id, "t", "m"),
                      fn.sum("m", "t"),
                  )
                  for etype, e_id in edge_dict.items()
              },
              cross_reducer="mean",
          )
  
          new_h = {}
          for ntype in G.ntypes:
              """
              Step 3: Target-specific Aggregation
              x = norm( W[node_type] * gelu( Agg(x) ) + x )
              """
              n_id = node_dict[ntype]
              alpha = torch.sigmoid(self.skip[n_id])
              t = G.nodes[ntype].data["t"].view(-1, self.out_dim)
              trans_out = self.drop(self.a_linears[n_id](t))
              trans_out = trans_out * alpha + h[ntype] * (1 - alpha)
              if self.use_norm:
                  new_h[ntype] = self.norms[n_id](trans_out)
              else:
                  new_h[ntype] = trans_out
          return new_h
  
imports: import logging
  import dgl
  import math
  import torch
  import torch.nn
  import torch.nn.functional
  import dgl.function
  from dgl.nn.functional import edge_softmax
  from ..None import register_model
  from .base import BaseHeteroModelMaintainer
  from ..base import activate_func
  from .....utils import get_logger
label_desc: Use image node_id 2 for calling the HGTLayer obj's underlying member method code with example usage: obj.forward(G, h) and returns: new_h