class_docstr: Encoder based on "Convolutional Sequence to Sequence Learning"
  :cite:`DBLP:journals/corr/GehringAGYD17`.
docstr: See :func:`EncoderBase.forward()`
code: def forward(self, input, src_len=None, hidden=None):
      """See :func:`EncoderBase.forward()`"""
      # batch x len x dim
      emb = self.embeddings(input)
  
      emb_reshape = emb.view(emb.size(0) * emb.size(1), -1)
      emb_remap = self.linear(emb_reshape)
      emb_remap = emb_remap.view(emb.size(0), emb.size(1), -1)
      emb_remap = shape_transform(emb_remap)
      out = self.cnn(emb_remap)
  
      return out.squeeze(3), emb_remap.squeeze(3), src_len
  
file_path: OpenNMT-py/onmt/encoders/cnn_encoder.py
imports: import torch.nn
  from onmt.encoders.encoder import EncoderBase
  from onmt.utils.cnn_factory import shape_transform, StackedCNN
label_desc: Use image node_id 3 for calling the CNNEncoder obj's underlying member method code with example usage: obj.forward(input, src_len, hidden) and returns: out,  emb_remap,  src_len