docstr: Shape of z: (N, M , D*K)
  N: number of nodes
  M: number of metapath patterns
  D: hidden_size
  K: number of heads
docstr_tok: ["Shape","of","z",":","(","N",",","M",",","D","*","K",")","N",":","number","of","nodes","M",":","number","of","metapath","patterns","D",":","hidden_size","K",":","number","of","heads"]
code: def forward(self, z):
      """
      Shape of z: (N, M , D*K)
      N: number of nodes
      M: number of metapath patterns
      D: hidden_size
      K: number of heads
      """
      w = self.project(z).mean(0)  # (M, 1)
      beta = torch.softmax(w, dim=0)  # (M, 1)
      beta = beta.expand((z.shape[0],) + beta.shape)  # (N, M, 1)
  
      return (beta * z).sum(1)
  
imports: import dgl
  import dgl.function
  import torch
  import torch.nn
  import torch.nn.functional
  from dgl.nn.pytorch import GATConv
label_desc: Use image node_id 2 for calling the SemanticAttention obj's underlying member method code with example usage: obj.forward(z) and returns: unknown