class_docstr: CNN based representation of a document.
code: def __init__(self, config: Config, embed_dim: int) -> None:
      super().__init__(config)
      self.max_kernel = max(config.cnn.kernel_sizes)
      self.convs = nn.ModuleList(
          [
              nn.Conv1d(embed_dim, config.cnn.kernel_num, K, padding=K)
              for K in config.cnn.kernel_sizes
          ]
      )
      self.dropout = nn.Dropout(config.dropout)
      self.representation_dim = (
          len(config.cnn.kernel_sizes) * config.cnn.kernel_num
      )
      self.pooling_type = config.pooling
      log_class_usage(__class__)
  
file_path: pytext/pytext/models/representations/docnn.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from pytext.config import ConfigBase
  from pytext.config.module_config import CNNParams, PoolingType
  from pytext.utils.usage import log_class_usage
  from .representation_base import RepresentationBase
label_desc: Use image node_id 1 to create a new DocNNRepresentation object from inherited base classes: RepresentationBase with example: obj = DocNNRepresentation(config, embed_dim)