class_docstr: Bidirectional LSTM running over word embeddings.
class_docstr_tok: ["Bidirectional","LSTM","running","over","word","embeddings","."]
code: def forward(self, features):
      token_embeddings = features["token_embeddings"]
      sentence_lengths = torch.clamp(
          features["sentence_lengths"], min=1
      )
  
      packed = nn.utils.rnn.pack_padded_sequence(
          token_embeddings,
          sentence_lengths.cpu(),
          batch_first=True,
          enforce_sorted=False,
      )
      packed = self.encoder(packed)
      unpack = nn.utils.rnn.pad_packed_sequence(
          packed[0], batch_first=True
      )[0]
      features.update({"token_embeddings": unpack})
      return features
  
file_path: sentence-transformers/sentence_transformers/models/LSTM.py
imports: import torch
  from torch import nn
  from typing import List
  import os
  import json
label_desc: Use image node_id 2 for calling the LSTM obj's underlying member method code with example usage: obj.forward(features) and returns: features