code: def squeeze(name, x, factor, inverse):
      """Temporal squeezing of x to increase the number of channels."""
      with tf.variable_scope(name, reuse=tf.AUTO_REUSE):
          if factor == 1:
              return x
          batch_size, length, n_channels = common_layers.shape_list(x)
          if not inverse:
              x = tf.reshape(
                  x, [batch_size, length // factor, factor, n_channels]
              )
              # transposing groups neighbouring elements together.
              x = tf.transpose(x, [0, 1, 3, 2])
              x = tf.reshape(
                  x, [batch_size, length // factor, n_channels * factor]
              )
          else:
              x = tf.reshape(
                  x, (batch_size, length, n_channels // factor, factor)
              )
              x = tf.transpose(x, [0, 1, 3, 2])
              x = tf.reshape(
                  x, (batch_size, length * factor, n_channels // factor)
              )
          return x
  
file_path: tensor2tensor/tensor2tensor/layers/transformer_glow_layers.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import numpy
  import scipy
  from tensor2tensor.layers import common_layers
  import tensor2tensor.layers.transformer_glow_layers_ops
  import tensorflow.compat.v1
label_desc: Use image node_id 9 for calling a global function with example usage: squeeze(name, x, factor, inverse) and returns: x, x