docstr: Args:
      input_size: dimention of input embedding
      kernel_size: kernel_size for CNN
      padding: padding for CNN
  hidden_size: hidden size
docstr_tok: ["Args",":","input_size",":","dimention","of","input","embedding","kernel_size",":","kernel_size","for","CNN","padding",":","padding","for","CNN","hidden_size",":","hidden","size"]
code: def __init__(self, kernel_size, segment_num=None):
      """
      Args:
          input_size: dimention of input embedding
          kernel_size: kernel_size for CNN
          padding: padding for CNN
      hidden_size: hidden size
      """
      super().__init__()
      self.segment_num = segment_num
      if self.segment_num != None:
          self.mask_embedding = nn.Embedding(
              segment_num + 1, segment_num
          )
          self.mask_embedding.weight.data.copy_(
              torch.FloatTensor(
                  np.concatenate(
                      [np.zeros(segment_num), np.identity(segment_num)],
                      axis=0,
                  )
              )
          )
          self.mask_embedding.weight.requires_grad = False
      self.pool = nn.AvgPool1d(kernel_size)
  
file_path: OpenNRE/opennre/module/pool/avg_pool.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  import numpy
label_desc: Use image node_id 1 to create a new AvgPool object from inherited base classes: nn with example: obj = AvgPool(kernel_size, segment_num)