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 : DGLGraph
      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",":","DGLGraph","The","heterogeneous","graph","h",":","tensor","Input","features","Outputs","--","--","--","-","tensor","The","output","feature"]
code: def __init__(
      self, meta_paths, in_size, out_size, layer_num_heads, dropout
  ):
      super(HANLayer, self).__init__()
  
      # One GAT layer for each meta path based adjacency matrix
      self.gat_layers = nn.ModuleList()
      for i in range(len(meta_paths)):
          self.gat_layers.append(
              GATConv(
                  in_size,
                  out_size,
                  layer_num_heads,
                  dropout,
                  dropout,
                  activation=F.elu,
                  allow_zero_in_degree=True,
              )
          )
      self.semantic_attention = SemanticAttention(
          in_size=out_size * layer_num_heads
      )
      self.meta_paths = list(
          tuple(meta_path) for meta_path in meta_paths
      )
  
      self._cached_graph = None
      self._cached_coalesced_graph = {}
  
file_path: dgl/examples/pytorch/han/model_hetero.py
imports: import dgl
  import torch
  import torch.nn
  import torch.nn.functional
  from dgl.nn.pytorch import GATConv
label_desc: Use image node_id 1 to create a new HANLayer object from inherited base classes: nn with example: obj = HANLayer(meta_paths, in_size, out_size, layer_num_heads, dropout)