code: def visualize_tensors(
      name, imgs, scale_func=lambda x: (x + 1.0) * 128.0, max_outputs=1
  ):
      """Generate tensor for TensorBoard (casting, clipping)
  
      Args:
          name: name for visualization operation
          *imgs: multiple tensors as list
          scale_func: scale input tensors to fit range [0, 255]
  
      Example:
          visualize_tensors('viz1', [img1])
          visualize_tensors('viz2', [img1, img2, img3], max_outputs=max(30, BATCH))
      """
      xy = scale_func(tf.concat(imgs, axis=2))
      xy = tf.cast(tf.clip_by_value(xy, 0, 255), tf.uint8, name="viz")
      tf.summary.image(name, xy, max_outputs=30)
  
imports: import argparse
  import functools
  import glob
  import numpy
  import os
  import cv2
  import tensorflow
  from tensorpack import *
  from tensorpack.tfutils.scope_utils import auto_reuse_variable_scope
  from tensorpack.tfutils.summary import add_moving_summary
  from tensorpack.utils.gpu import get_num_gpu
  from tensorpack.utils.viz import stack_patches
  from GAN import GANModelDesc, GANTrainer
label_desc: Use image node_id 2 for calling a global function with example usage: visualize_tensors(name, imgs, scale_func, max_outputs) without return types