code: def van(
      first_enc,
      first_frame,
      current_enc,
      gt_image,
      reuse=False,
      scope_prefix="",
      hparams=None,
  ):
      """Implements a VAN.
  
      Args:
        first_enc: The first encoding.
        first_frame: The first ground truth frame.
        current_enc: The encoding of the frame to generate.
        gt_image: The ground truth image, only used for regularization.
        reuse: To reuse in variable scope or not.
        scope_prefix: The prefix before the scope name.
        hparams: The python hparams.
  
      Returns:
        The generated image.
      """
      with tf.variable_scope(scope_prefix + "van", reuse=reuse):
          output_shape = first_frame.get_shape().as_list()
          output_shape[0] = -1
  
          first_depth = 64
  
          f_first_enc, _ = van_enc_2d(first_enc, first_depth)
          f_first_frame, image_enc_history = van_image_enc_2d(
              first_frame, first_depth, hparams=hparams
          )
          f_current_enc, van_higher_level = van_enc_2d(
              current_enc, first_depth, reuse=True
          )
          f_gt_image, _ = van_image_enc_2d(
              gt_image, first_depth, True, hparams=hparams
          )
  
          analogy_t = analogy_computation_2d(
              f_first_enc, f_first_frame, f_current_enc, first_depth
          )
          enc_img = f_current_enc + analogy_t
  
          img = van_dec_2d(
              enc_img,
              image_enc_history,
              output_shape,
              first_depth,
              hparams=hparams,
          )
  
          batch_size = tf.to_float(tf.shape(first_enc)[0])
          r_loss = (
              tf.nn.l2_loss(f_gt_image - f_current_enc - analogy_t)
              / batch_size
          )
  
          return img, r_loss, van_higher_level
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from six.moves import reduce
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import common_video
  from tensor2tensor.models.video import epva_params
  from tensor2tensor.models.video import sv2p
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
  from tensorflow.contrib.framework.python.ops import arg_scope
  from tensorflow.contrib.slim.python.slim.nets import vgg
label_desc: Use image node_id 5 for calling a global function with example usage: van(first_enc, first_frame, current_enc, gt_image, reuse, scope_prefix, hparams) and returns: img,  r_loss,  van_higher_level