code: def pool(
      pooling_type: str,
      words: Tensor,
      encoder_padding_mask: Optional[Tensor],
  ):
      # input dims: bsz * seq_len * num_filters
      if pooling_type == "mean":
          return mean(words, encoder_padding_mask)
      elif pooling_type == "max":
          return words.max(dim=1)[0]
      elif pooling_type == "none":
          return words
      else:
          raise NotImplementedError
  
imports: from typing import List, Optional, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from pytext.config.module_config import Activation, ModuleConfig
  from pytext.models.module import create_module, Module
  from pytext.optimizer import get_activation
  from torch import Tensor
  from .light_conv import LightweightConv
label_desc: Use image node_id 2 for calling a global function with example usage: pool(pooling_type, words, encoder_padding_mask) and returns: mean, words, words