class_docstr: TreeLSTM from DGL.
class_docstr_tok: ["TreeLSTM","from","DGL","."]
code: def forward(self, g, label, indices, topo, lengths):
      n_nodes = g.number_of_nodes()
      h = torch.zeros(n_nodes, self.hidden_size, device="cuda:0")
      c = torch.zeros(n_nodes, self.hidden_size, device="cuda:0")
      iou = self.emb(label.cuda())
  
      g = run(
          self.tree_lstm, g, self.tree_lstm.W_iou(iou), h, c, topo=topo
      )
      final = torch.stack(
          [g[indices[i, 0][0]] for i, l in enumerate(lengths)]
      )
      final = self.out(final).log_softmax(dim=-1)
      return final
  
file_path: pytorch-struct/examples/networks/TreeLSTM.py
imports: import torch
  import torch
  import torch.nn
  import dgl
  from torch_struct import CKY
label_desc: Use image node_id 2 for calling the TreeLSTM obj's underlying member method code with example usage: obj.forward(g, label, indices, topo, lengths) and returns: final