docs: def sample_norm(x):
      """
      pixel norm as described in section 4.2 here:
      https://arxiv.org/pdf/1710.10196.pdf
      """
      original = x
      # square
      x = x ** 2
      # feature-map-wise sum
      x = torch.sum(x, dim=1)
      # scale by number of feature maps
      x *= 1.0 / original.shape[1]
      x += 10e-8
      x = torch.sqrt(x)
      return original / x.view(-1, 1, x.shape[-1])