class_docstr: RNN encoder using nn.LSTM for cuDNN support / ONNX exportability.
class_docstr_tok: ["RNN","encoder","using","nn.LSTM","for","cuDNN","support","\/","ONNX","exportability","."]
code: def forward(
      self,
      src_tokens: torch.Tensor,
      embeddings: torch.Tensor,
      src_lengths,
  ) -> Dict[str, torch.Tensor]:
      x = F.dropout(
          embeddings, p=self.dropout_in, training=self.training
      )
  
      # B x T x C -> T x B x C
      x = x.transpose(0, 1)
  
      unpacked_output, final_hiddens, final_cells = self.bilstm(
          embeddings=x, lengths=src_lengths
      )
  
      return {
          "unpacked_output": unpacked_output,
          "final_hiddens": final_hiddens,
          "final_cells": final_cells,
          "src_lengths": src_lengths,
          "src_tokens": src_tokens,
          "embeddings": embeddings,
      }
  
file_path: pytext/pytext/models/seq_models/rnn_encoder.py
imports: from typing import Dict, List, Tuple
  import torch
  import torch.nn.functional
  from pytext.config import ConfigBase
  from pytext.utils.usage import log_class_usage
  from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
  from .base import PyTextSeq2SeqModule
label_desc: Use image node_id 3 for calling the LSTMSequenceEncoder obj's underlying member method code with example usage: obj.forward(src_tokens, embeddings, src_lengths) and returns: dict