class_docstr: HAN layer.
  
  Arguments
  ---------
  meta_paths : list of metapaths, each as a list of edge types
  in_size : input feature dimension
  out_size : output feature dimension
  layer_num_heads : number of attention heads
  dropout : Dropout probability
  
  Inputs
  ------
  g : DGLHeteroGraph
      The heterogeneous graph
  h : tensor
      Input features
  
  Outputs
  -------
  tensor
      The output feature
class_docstr_tok: ["HAN","layer",".","Arguments","--","--","--","--","-","meta_paths",":","list","of","metapaths",",","each","as","a","list","of","edge","types","in_size",":","input","feature","dimension","out_size",":","output","feature","dimension","layer_num_heads",":","number","of","attention","heads","dropout",":","Dropout","probability","Inputs","--","--","--","g",":","DGLHeteroGraph","The","heterogeneous","graph","h",":","tensor","Input","features","Outputs","--","--","--","-","tensor","The","output","feature"]
code: def forward(self, g, h):
      semantic_embeddings = []
  
      if self._cached_graph is None or self._cached_graph is not g:
          self._cached_graph = g
          self._cached_coalesced_graph.clear()
          for meta_path in self.meta_paths:
              self._cached_coalesced_graph[
                  meta_path
              ] = dgl.metapath_reachable_graph(g, meta_path)
  
      for i, meta_path in enumerate(self.meta_paths):
          new_g = self._cached_coalesced_graph[meta_path]
          semantic_embeddings.append(
              self.gat_layers[i](new_g, h).flatten(1)
          )
      semantic_embeddings = torch.stack(
          semantic_embeddings, dim=1
      )  # (N, M, D * K)
  
      return self.semantic_attention(semantic_embeddings)
  
file_path: AutoGL/test/performance/heterogeneous/dgl/han_base/model_hetero.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  import dgl
  from dgl.nn.pytorch import GATConv
label_desc: Use image node_id 2 for calling the HANLayer obj's underlying member method code with example usage: obj.forward(g, h) and returns: self