class_docstr: Encoder Module.
  
  Args:
      encoder_embedding_dim (int): Number of embedding dimensions in the encoder.
      encoder_n_convolution (int): Number of convolution layers in the encoder.
      encoder_kernel_size (int): The kernel size in the encoder.
  
  Examples
      >>> encoder = _Encoder(3, 512, 5)
      >>> input = torch.rand(10, 20, 30)
      >>> output = encoder(input)  # shape: (10, 30, 512)
class_docstr_tok: ["Encoder","Module",".","Args",":","encoder_embedding_dim","(","int",")",":","Number","of","embedding","dimensions","in","the","encoder",".","encoder_n_convolution","(","int",")",":","Number","of","convolution","layers","in","the","encoder",".","encoder_kernel_size","(","int",")",":","The","kernel","size","in","the","encoder",".","Examples",">",">",">","encoder","=","_Encoder","(","3",",","512",",","5",")",">",">",">","input","=","torch.rand","(","10",",","20",",","30",")",">",">",">","output","=","encoder","(","input",")","#","shape",":","(","10",",","30",",","512",")"]
docstr: Pass the input through the Encoder.
  
  Args:
      x (Tensor): The input sequences with shape (n_batch, encoder_embedding_dim, n_seq).
      input_lengths (Tensor): The length of each input sequence with shape (n_batch, ).
  
  Return:
      x (Tensor): A tensor with shape (n_batch, n_seq, encoder_embedding_dim).
docstr_tok: ["Pass","the","input","through","the","Encoder",".","Args",":","x","(","Tensor",")",":","The","input","sequences","with","shape","(","n_batch",",","encoder_embedding_dim",",","n_seq",")",".","input_lengths","(","Tensor",")",":","The","length","of","each","input","sequence","with","shape","(","n_batch",",",")",".","Return",":","x","(","Tensor",")",":","A","tensor","with","shape","(","n_batch",",","n_seq",",","encoder_embedding_dim",")","."]
code: def forward(self, x: Tensor, input_lengths: Tensor) -> Tensor:
      r"""Pass the input through the Encoder.
  
      Args:
          x (Tensor): The input sequences with shape (n_batch, encoder_embedding_dim, n_seq).
          input_lengths (Tensor): The length of each input sequence with shape (n_batch, ).
  
      Return:
          x (Tensor): A tensor with shape (n_batch, n_seq, encoder_embedding_dim).
      """
  
      for conv in self.convolutions:
          x = F.dropout(F.relu(conv(x)), 0.5, self.training)
  
      x = x.transpose(1, 2)
  
      input_lengths = input_lengths.cpu()
      x = nn.utils.rnn.pack_padded_sequence(
          x, input_lengths, batch_first=True
      )
  
      outputs, _ = self.lstm(x)
      outputs, _ = nn.utils.rnn.pad_packed_sequence(
          outputs, batch_first=True
      )
  
      return outputs
  
imports: import warnings
  from typing import List, Optional, Tuple, Union
  import torch
  from torch import nn, Tensor
  from torch.nn import functional
label_desc: Use image node_id 2 for calling the _Encoder obj's underlying member method code with example usage: obj.forward(x, input_lengths) and returns: outputs