code: def forward(self, inp, mask, ent_len=None):
      inp = self.drop(inp)
      lens = (mask == 0).sum(-1).long().tolist()
      pad_seq = pack_padded_sequence(
          inp, lens, batch_first=True, enforce_sorted=False
      )
      y, (_h, _c) = self.bilstm(pad_seq)
      if self.enc_type == "title":
          y = pad_packed_sequence(y, batch_first=True)[0]
          return y
      if self.enc_type == "entity":
          _h = _h.transpose(0, 1).contiguous()
          _h = _h[:, -2:].view(
              _h.size(0), -1
          )  # two directions of the top-layer
          ret = pad(_h.split(ent_len), out_type="tensor")
          return ret
  
imports: import math
  import torch
  import torch.nn.functional
  from torch import nn
  from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
  from utlis import *
  import dgl.function
  from dgl.nn.functional import edge_softmax
label_desc: Use image node_id 2 for calling the BiLSTM obj's underlying member method code with example usage: obj.forward(inp, mask, ent_len) and returns: y, ret