code: def __init__(self, args):
      super(GraphWriter, self).__init__()
      self.args = args
      if args.title:
          self.title_emb = nn.Embedding(
              len(args.title_vocab), args.nhid, padding_idx=0
          )
          self.title_enc = BiLSTM(args, enc_type="title")
          self.title_attn = MSA(args)
      self.ent_emb = nn.Embedding(
          len(args.ent_text_vocab), args.nhid, padding_idx=0
      )
      self.tar_emb = nn.Embedding(
          len(args.text_vocab), args.nhid, padding_idx=0
      )
      if args.title:
          nn.init.xavier_normal_(self.title_emb.weight)
      nn.init.xavier_normal_(self.ent_emb.weight)
      self.rel_emb = nn.Embedding(
          len(args.rel_vocab), args.nhid, padding_idx=0
      )
      nn.init.xavier_normal_(self.rel_emb.weight)
      self.decode_lstm = nn.LSTMCell(args.dec_ninp, args.nhid)
      self.ent_enc = BiLSTM(args, enc_type="entity")
      self.graph_enc = GraphTrans(args)
      self.ent_attn = MSA(args)
      self.copy_attn = MSA(args, mode="copy")
      self.copy_fc = nn.Linear(args.dec_ninp, 1)
      self.pred_v_fc = nn.Linear(args.dec_ninp, len(args.text_vocab))
  
file_path: dgl/examples/pytorch/graphwriter/graphwriter.py
imports: import torch
  from modules import BiLSTM, GraphTrans, MSA
  from torch import nn
  from utlis import *
  import dgl
label_desc: Use image node_id 1 to create a new GraphWriter object from inherited base classes: nn with example: obj = GraphWriter(args)