class_docstr: https://arxiv.org/pdf/1902.05509v2.pdf
  https://amaarora.github.io/2020/08/30/gempool.html
class_docstr_tok: ["https",":","\/\/arxiv.org\/pdf\/1902.05509v2.pdf","https",":","\/\/amaarora.github.io\/2020\/08\/30\/gempool.html"]
code: def forward(self, x: Tensor) -> Tensor:
      x = F.adaptive_avg_pool2d(
          x.clamp_min(self.eps).pow(self.p), output_size=1
      ).pow(1.0 / self.p)
      if self.flatten:
          x = x.view(x.size(0), x.size(1))
  
      return x
  
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 2 for calling the GeneralizedMeanPooling2d obj's underlying member method code with example usage: obj.forward(x) and returns: x