class_docstr: SpanLSTM model.
code: def forward(self, words, lengths):
      self.emb.weight[1].data.zero_()
      batch, N = words.shape
  
      f, ba = self.lstm(self.emb(words))[0].chunk(2, dim=2)
      a = torch.zeros(batch, N, N, self.H).type_as(f)
      b = torch.zeros(batch, N, N, self.H).type_as(f)
      a[:, :, : N - 1] = f[:, 1:].view(batch, 1, N - 1, self.H) - f[
          :
      ].view(batch, N, 1, self.H)
      b[:, 1:, :] = ba[:, : N - 1].view(
          batch, N - 1, 1, self.H
      ) - ba.view(batch, 1, N, self.H)
      out = self.proj(self.res(torch.cat([a, b], dim=-1)))
      return out
  
file_path: pytorch-struct/examples/networks/SpanLSTM.py
imports: import torch.nn
  import torch
label_desc: Use image node_id 2 for calling the SpanLSTM obj's underlying member method code with example usage: obj.forward(words, lengths) and returns: out