docstr: Compute tree-lstm prediction given a batch.
  Parameters
  ----------
  batch : dgl.data.SSTBatch
      The data batch.
  g : dgl.DGLGraph
      Tree for computation.
  h : Tensor
      Initial hidden state.
  c : Tensor
      Initial cell state.
  Returns
  -------
  logits : Tensor
      The prediction of each node.
docstr_tok: ["Compute","tree-lstm","prediction","given","a","batch",".","Parameters","--","--","--","--","--","batch",":","dgl.data.SSTBatch","The","data","batch",".","g",":","dgl.DGLGraph","Tree","for","computation",".","h",":","Tensor","Initial","hidden","state",".","c",":","Tensor","Initial","cell","state",".","Returns","--","--","--","-","logits",":","Tensor","The","prediction","of","each","node","."]
code: def forward(self, batch, g, h, c):
      """Compute tree-lstm prediction given a batch.
      Parameters
      ----------
      batch : dgl.data.SSTBatch
          The data batch.
      g : dgl.DGLGraph
          Tree for computation.
      h : Tensor
          Initial hidden state.
      c : Tensor
          Initial cell state.
      Returns
      -------
      logits : Tensor
          The prediction of each node.
      """
      # feed embedding
      embeds = self.embedding(batch.wordid * batch.mask)
      g.ndata["iou"] = self.cell.W_iou(
          self.dropout(embeds)
      ) * batch.mask.float().unsqueeze(-1)
      g.ndata["h"] = h
      g.ndata["c"] = c
      # propagate
      dgl.prop_nodes_topo(
          g,
          self.cell.message_func,
          self.cell.reduce_func,
          apply_node_func=self.cell.apply_node_func,
      )
      # compute logits
      h = self.dropout(g.ndata.pop("h"))
      logits = self.linear(h)
      return logits
  
imports: import itertools
  import time
  import dgl
  import networkx
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 2 for calling the TreeLSTM obj's underlying member method code with example usage: obj.forward(batch, g, h, c) and returns: logits