Since the following answer implement L2 Pooling in TF
  
      stackoverflow.com
  
  
      
    
  

  How to use L2 pooling in Tensorflow? 9



  python, tensorflow, conv-neural-network



  asked by
  
  
    YW P Kwon
  
  on 10:55AM - 14 Apr 16 UTC


  
  
    
    
  
  


May be it would be
class L2Pool(nn.Module):
    def __init__(self, *args, **kwargs):
        super().__init__()
        self.pool = nn.AvgPool2d(*args, **kwargs)
    def forward(self, x):
        return torch.sqrt(self.pool(x ** 2))

I AM NOT SURE IT IS RIGHT…