code: def forward(self, sent_tuple):
      # sent_len: [max_len, ..., min_len] (bsize)
      # sent: (seqlen x bsize x worddim)
      sent, sent_len = sent_tuple
  
      # Sort by length (keep idx)
      sent_len_sorted, idx_sort = np.sort(sent_len)[::-1], np.argsort(
          -sent_len
      )
      sent_len_sorted = sent_len_sorted.copy()
      idx_unsort = np.argsort(idx_sort)
  
      idx_sort = (
          torch.from_numpy(idx_sort).to(textattack.shared.utils.device)
          if self.is_cuda()
          else torch.from_numpy(idx_sort)
      )
      sent = sent.index_select(1, idx_sort)
  
      # Handling padding in Recurrent Networks
      sent_packed = nn.utils.rnn.pack_padded_sequence(
          sent, sent_len_sorted
      )
      sent_output = self.enc_lstm(sent_packed)[
          0
      ]  # seqlen x batch x 2*nhid
      sent_output = nn.utils.rnn.pad_packed_sequence(sent_output)[0]
  
      # Un-sort by length
      idx_unsort = (
          torch.from_numpy(idx_unsort).to(
              textattack.shared.utils.device
          )
          if self.is_cuda()
          else torch.from_numpy(idx_unsort)
      )
      sent_output = sent_output.index_select(1, idx_unsort)
  
      # Pooling
      if self.pool_type == "mean":
          sent_len = (
              torch.FloatTensor(sent_len.copy())
              .unsqueeze(1)
              .to(textattack.shared.utils.device)
          )
          emb = torch.sum(sent_output, 0).squeeze(0)
          emb = emb / sent_len.expand_as(emb)
      elif self.pool_type == "max":
          if not self.max_pad:
              sent_output[sent_output == 0] = -1e9
          emb = torch.max(sent_output, 0)[0]
          if emb.ndimension() == 3:
              emb = emb.squeeze(0)
              assert emb.ndimension() == 2
  
      return emb
  
imports: import time
  import numpy
  import torch
  from torch import nn
  import textattack
label_desc: Use image node_id 3 for calling the InferSentModel obj's underlying member method code with example usage: obj.forward(sent_tuple) and returns: emb