code: def psnr_and_ssim(output, target):
    
    output = tf.cast(output, dtype=tf.int32)
    target = tf.cast(target, dtype=tf.int32)
    psnr = tf.image.psnr(output, target, max_val=255)
    ssim = tf.image.ssim(output, target, max_val=255)
    return psnr, ssim
docs: Compute the PSNR and SSIM.
  
    Args:
      output: 4-D Tensor, shape=(num_frames, height, width, num_channels)
      target: 4-D Tensor, shape=(num_frames, height, width, num_channels)
    Returns:
      psnr: 1-D Tensor, shape=(num_frames,)
      ssim: 1-D Tensor, shape=(num_frames,)