class_docstr: HAN layer.
  
  Arguments
  ---------
  num_metapath : number of metapath based sub-graph
  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","--","--","--","--","-","num_metapath",":","number","of","metapath","based","sub-graph","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, num_metapath, 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(num_metapath):
          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.num_metapath = num_metapath
  
imports: import dgl
  import numpy
  import argparse
  import torch
  import torch.nn
  import torch.nn.functional
  from dgl.nn.pytorch import GATConv
  from dgl.sampling import RandomWalkNeighborSampler
  from sklearn.metrics import f1_score
  from torch.utils.data import DataLoader
  from model_hetero import SemanticAttention
  from utils import EarlyStopping, set_random_seed
label_desc: Use image node_id 1 to create a new HANLayer object from inherited base classes: torch.nn with example: obj = HANLayer(num_metapath, in_size, out_size, layer_num_heads, dropout)