code: def tile_and_concat(image, latent, concat_latent=True):
      """Tile latent and concatenate to image across depth.
  
      Args:
        image: 4-D Tensor, (batch_size X height X width X channels)
        latent: 2-D Tensor, (batch_size X latent_dims)
        concat_latent: If set to False, the image is returned as is.
  
      Returns:
        concat_latent: 4-D Tensor, (batch_size X height X width X channels+1)
          latent tiled and concatenated to the image across the channels.
      """
      if not concat_latent:
          return image
      image_shape = common_layers.shape_list(image)
      latent_shape = common_layers.shape_list(latent)
      height, width = image_shape[1], image_shape[2]
      latent_dims = latent_shape[1]
      height_multiples = height // latent_dims
      pad = height - (height_multiples * latent_dims)
      latent = tf.reshape(latent, (-1, latent_dims, 1, 1))
      latent = tf.tile(latent, (1, height_multiples, width, 1))
      latent = tf.pad(
          latent, [[0, 0], [pad // 2, pad // 2], [0, 0], [0, 0]]
      )
      return tf.concat([image, latent], axis=-1)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from tensor2tensor.layers import common_layers
  from tensor2tensor.utils import contrib
  import tensorflow.compat.v1
  from tensorflow.python.ops import summary_op_util
label_desc: Use image node_id 13 for calling a global function with example usage: tile_and_concat(image, latent, concat_latent) and returns: tf, image