class_docstr: One layer of CARE-GNN.
class_docstr_tok: ["One","layer","of","CARE-GNN","."]
code: def forward(self, g, feat):
      g.srcdata["h"] = feat
  
      # formula 8
      hr = {}
      for etype in g.canonical_etypes:
          g.update_all(
              fn.copy_u("h", "m"), fn.mean("m", "hr"), etype=etype
          )
          hr[etype] = g.dstdata["hr"]
          if self.activation is not None:
              hr[etype] = self.activation(hr[etype])
  
      # formula 9 using mean as inter-relation aggregator
      p_tensor = (
          th.Tensor(list(self.p.values()))
          .view(-1, 1, 1)
          .to(feat.device)
      )
      h_homo = th.sum(th.stack(list(hr.values())) * p_tensor, dim=0)
      h_homo += feat[: g.number_of_dst_nodes()]
      if self.activation is not None:
          h_homo = self.activation(h_homo)
  
      return self.linear(h_homo)
  
imports: import dgl
  import dgl.function
  import numpy
  import torch
  import torch.nn
label_desc: Use image node_id 2 for calling the CAREConv obj's underlying member method code with example usage: obj.forward(g, feat) and returns: self