code: def compress(x, hparams, name):
      """Compress."""
      with tf.variable_scope(name):
          # Run compression by strided convs.
          cur = x
          k1 = (3, 1)
          k2 = (2, 1)
          cur = residual_conv(
              cur, hparams.num_compress_steps, k1, hparams, "rc"
          )
          for i in range(hparams.num_compress_steps):
              cur = common_layers.conv_block(
                  cur,
                  hparams.hidden_size,
                  [((1, 1), k2)],
                  strides=k2,
                  name="compress_%d" % i,
              )
          return cur
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  from six.moves import range
  from tensor2tensor.layers import common_layers
  from tensor2tensor.models import transformer
  from tensor2tensor.utils import beam_search
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  from tensorflow.python.training import moving_averages
label_desc: Use image node_id 7 for calling a global function with example usage: compress(x, hparams, name) and returns: cur