code: def van_image_enc_2d(x, first_depth, reuse=False, hparams=None):
      """The image encoder for the VAN.
  
      Similar architecture as Ruben's paper
      (http://proceedings.mlr.press/v70/villegas17a/villegas17a.pdf).
  
      Args:
        x: The image to encode.
        first_depth: The depth of the first layer. Depth is increased in subsequent
          layers.
        reuse: To reuse in variable scope or not.
        hparams: The python hparams.
  
      Returns:
        The encoded image.
      """
      with tf.variable_scope("van_image_enc", reuse=reuse):
          enc_history = [x]
  
          enc = tf.layers.conv2d(
              x,
              first_depth,
              3,
              padding="same",
              activation=tf.nn.relu,
              strides=1,
          )
          enc = contrib.layers().layer_norm(enc)
          enc = tf.layers.conv2d(
              enc,
              first_depth,
              3,
              padding="same",
              activation=tf.nn.relu,
              strides=1,
          )
          enc = tf.nn.max_pool(enc, [1, 2, 2, 1], [1, 2, 2, 1], "SAME")
          enc = tf.nn.dropout(enc, hparams.van_keep_prob)
          enc = contrib.layers().layer_norm(enc)
          enc_history.append(enc)
  
          enc = tf.layers.conv2d(
              enc,
              first_depth * 2,
              3,
              padding="same",
              activation=tf.nn.relu,
              strides=1,
          )
          enc = tf.layers.conv2d(
              enc,
              first_depth * 2,
              3,
              padding="same",
              activation=tf.nn.relu,
              strides=1,
          )
          enc = tf.nn.max_pool(enc, [1, 2, 2, 1], [1, 2, 2, 1], "SAME")
          enc = tf.nn.dropout(enc, hparams.van_keep_prob)
          enc = contrib.layers().layer_norm(enc)
          enc_history.append(enc)
  
          enc = tf.layers.conv2d(
              enc,
              first_depth * 4,
              3,
              padding="same",
              activation=tf.nn.relu,
              strides=1,
          )
          enc = tf.layers.conv2d(
              enc,
              first_depth * 4,
              3,
              padding="same",
              activation=tf.nn.relu,
              strides=1,
          )
          enc = tf.layers.conv2d(
              enc,
              first_depth * 4,
              3,
              padding="same",
              activation=tf.nn.relu,
              strides=1,
          )
          enc = tf.nn.max_pool(enc, [1, 2, 2, 1], [1, 2, 2, 1], "SAME")
  
          return enc, enc_history
  
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 1 for calling a global function with example usage: van_image_enc_2d(x, first_depth, reuse, hparams) and returns: enc,  enc_history