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
code: def __init__(
      self, meta_paths, in_size, out_size, layer_num_heads, dropout, act
  ):
      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=act,
                  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 = {}
  
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 dgl.nn.pytorch import GATConv
  from functools import partial
  from ..._utils import activation
  from ..None import register_model
  from .base import BaseHeteroModelMaintainer
  from .....utils import get_logger
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, act)