code: def calculate_psnr(self, img1, img2):
      # img1 and img2 have range [0, 1]
      mse = ((img1 * 255 - img2 * 255) ** 2).mean()
      if mse == 0:
          return float("inf")
      return 20 * paddle.log10(255.0 / paddle.sqrt(mse))
  
imports: from math import exp
  import paddle
  import paddle.nn.functional
  import paddle.nn
  import string
label_desc: Use image node_id 3 for calling the SRMetric obj's underlying member method code with example usage: obj.calculate_psnr(img1, img2) and returns: unknown, float