code: def squeeze(name, x, factor=2, reverse=True):
      """Block-wise spatial squeezing of x to increase the number of channels.
  
      Args:
        name: Used for variable scoping.
        x: 4-D Tensor of shape (batch_size X H X W X C)
        factor: Factor by which the spatial dimensions should be squeezed.
        reverse: Squueze or unsqueeze operation.
  
      Returns:
        x: 4-D Tensor of shape (batch_size X (H//factor) X (W//factor) X
           (cXfactor^2). If reverse is True, then it is factor = (1 / factor)
      """
      with tf.variable_scope(name, reuse=tf.AUTO_REUSE):
          shape = common_layers.shape_list(x)
          if factor == 1:
              return x
          height = int(shape[1])
          width = int(shape[2])
          n_channels = int(shape[3])
  
          if not reverse:
              assert height % factor == 0 and width % factor == 0
              x = tf.reshape(
                  x,
                  [
                      -1,
                      height // factor,
                      factor,
                      width // factor,
                      factor,
                      n_channels,
                  ],
              )
              x = tf.transpose(x, [0, 1, 3, 5, 2, 4])
              x = tf.reshape(
                  x,
                  [
                      -1,
                      height // factor,
                      width // factor,
                      n_channels * factor * factor,
                  ],
              )
          else:
              x = tf.reshape(
                  x,
                  (
                      -1,
                      height,
                      width,
                      int(n_channels / factor**2),
                      factor,
                      factor,
                  ),
              )
              x = tf.transpose(x, [0, 1, 4, 2, 5, 3])
              x = tf.reshape(
                  x,
                  (
                      -1,
                      int(height * factor),
                      int(width * factor),
                      int(n_channels / factor**2),
                  ),
              )
          return x
  
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
  from tensor2tensor.layers import common_video
  from tensor2tensor.utils import contrib
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  import tensorflow_probability
label_desc: Use image node_id 25 for calling a global function with example usage: squeeze(name, x, factor, reverse) and returns: x, x