code: def compute_one_decoding_video_metrics(
      iterator, feed_dict, num_videos
  ):
      """Computes the average of all the metric for one decoding.
  
      Args:
        iterator: dataset iterator.
        feed_dict: feed dict to initialize iterator.
        num_videos: number of videos.
  
      Returns:
        all_psnr: 2-D Numpy array, shape=(num_samples, num_frames)
        all_ssim: 2-D Numpy array, shape=(num_samples, num_frames)
      """
      output, target = iterator.get_next()
      metrics = psnr_and_ssim(output, target)
  
      with tf.Session() as sess:
          sess.run(tf.local_variables_initializer())
          initalizer = (
              iterator._initializer
          )  # pylint: disable=protected-access
          if initalizer is not None:
              sess.run(initalizer, feed_dict=feed_dict)
  
          all_psnr, all_ssim = [], []
          for i in range(num_videos):
              print("Computing video: %d" % i)
              psnr_np, ssim_np = sess.run(metrics)
              all_psnr.append(psnr_np)
              all_ssim.append(ssim_np)
          all_psnr = np.array(all_psnr)
          all_ssim = np.array(all_ssim)
          return all_psnr, all_ssim
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import numpy
  import six
  import tensorflow.compat.v1
label_desc: Use image node_id 10 for calling a global function with example usage: compute_one_decoding_video_metrics(iterator, feed_dict, num_videos) and returns: all_psnr,  all_ssim