class_docstr: CNN based representation of a document.
code: def conv_and_pool(self, x, conv):
      x = F.relu(conv(x))
      if self.pooling_type == PoolingType.MAX:
          x, _ = torch.max(x, dim=2)
      elif self.pooling_type == PoolingType.MEAN:
          x = torch.mean(x, dim=2)
      elif self.pooling_type == PoolingType.LOGSUMEXP:
          x = torch.logsumexp(x, dim=2)
      else:
          raise NotImplementedError
      return x
  
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 3 for calling the DocNNRepresentation obj's underlying member method code with example usage: obj.conv_and_pool(x, conv) and returns: x