class_docstr: Encoder based on "Convolutional Sequence to Sequence Learning"
  :cite:`DBLP:journals/corr/GehringAGYD17`.
code: def __init__(
      self,
      num_layers,
      hidden_size,
      cnn_kernel_width,
      dropout,
      embeddings,
  ):
      super(CNNEncoder, self).__init__()
  
      self.embeddings = embeddings
      input_size = embeddings.embedding_size
      self.linear = nn.Linear(input_size, hidden_size)
      self.cnn = StackedCNN(
          num_layers, hidden_size, cnn_kernel_width, dropout
      )
  
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 1 to create a new CNNEncoder object from inherited base classes: EncoderBase with example: obj = CNNEncoder(num_layers, hidden_size, cnn_kernel_width, dropout, embeddings)