class_docstr: K-max global pooling block
  
  https://arxiv.org/abs/1911.07344
docstr: Global average pooling over the input's spatial dimensions
docstr_tok: ["Global","average","pooling","over","the","input","'s","spatial","dimensions"]
code: def __init__(self, k=4, trainable=True, flatten=False):
      """Global average pooling over the input's spatial dimensions"""
      super().__init__()
      self.k = k
      self.flatten = flatten
      self.trainable = trainable
      weights = torch.ones((1, 1, k))
      if trainable:
          self.register_parameter(
              "weights", torch.nn.Parameter(weights)
          )
      else:
          self.register_buffer("weights", weights)
  
imports: from typing import Union, Dict
  import torch
  import torch.nn.functional
  from torch.nn.modules.module import _IncompatibleKeys
  from torch import Tensor, nn
label_desc: Use image node_id 1 to create a new GlobalKMaxPool2d object from inherited base classes: nn with example: obj = GlobalKMaxPool2d(k, trainable, flatten)