class_docstr: 集合了 **Convolution** 和 **Max-Pooling** 于一体的层。给定一个 ``[batch_size, max_len, input_size]`` 的输入，返回
  ``[batch_size, sum(output_channels)]`` 大小的 matrix。在内部，是先使用 ``CNN`` 给输入做卷积，然后经过 activation 
  激活层，在通过在长度(max_len)这一维进行 ``max_pooling`` 。最后得到每个 sample 的一个向量表示。
  
  :param in_channels: 输入 channel 的大小，一般是 embedding 的维度，或 ``encoder``的 output 维度
  :param out_channels: 输出 channel 的数量。如果为 :class:`list`，则需要与 ``kernel_sizes`` 的数量保持一致
  :param kernel_sizes: 输出 channel 的 kernel 大小。
  :param activation: **卷积** 后的结果将通过该 ``activation`` 后再经过 ``max-pooling``。支持 ``['relu', 'sigmoid', 'tanh']``。
docstr: :param x: ``[batch_size, max_len, input_size]``，一般是经过 ``embedding`` 后的值
  :param mask: ``[batch_size, max_len]``，**0** 的位置表示 padding，不影响卷积运算，``max-pooling`` 一定不会 pool 到 padding 为 0 的位置
  :return:
docstr_tok: [":","param","x",":","``","[","batch_size",",","max_len",",","input_size","]","``","\uff0c\u4e00\u822c\u662f\u7ecf\u8fc7","``","embedding","``","\u540e\u7684\u503c",":","param","mask",":","``","[","batch_size",",","max_len","]","``","\uff0c","*","*","0","*","*","\u7684\u4f4d\u7f6e\u8868\u793a","padding\uff0c\u4e0d\u5f71\u54cd\u5377\u79ef\u8fd0\u7b97\uff0c","``","max-pooling","``","\u4e00\u5b9a\u4e0d\u4f1a","pool","\u5230","padding","\u4e3a","0","\u7684\u4f4d\u7f6e",":","return",":"]
code: def forward(self, x: torch.FloatTensor, mask=None):
      r"""
  
      :param x: ``[batch_size, max_len, input_size]``，一般是经过 ``embedding`` 后的值
      :param mask: ``[batch_size, max_len]``，**0** 的位置表示 padding，不影响卷积运算，``max-pooling`` 一定不会 pool 到 padding 为 0 的位置
      :return:
      """
      # [N,L,C] -> [N,C,L]
      x = torch.transpose(x, 1, 2)
      # convolution
      xs = [
          self.activation(conv(x)) for conv in self.convs
      ]  # [[N,C,L], ...]
      if mask is not None:
          mask = mask.unsqueeze(1)  # B x 1 x L
          xs = [
              x.masked_fill(mask.eq(False), float("-inf")) for x in xs
          ]
      # max-pooling
      xs = [
          F.max_pool1d(input=i, kernel_size=i.size(2)).squeeze(2)
          for i in xs
      ]  # [[N, C], ...]
      return torch.cat(xs, dim=-1)
  
imports: from typing import Union, List
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 2 for calling the ConvMaxpool obj's underlying member method code with example usage: obj.forward(x, mask) and returns: torch