code: def shake_shake_skip_connection(
      x, output_filters, stride, is_training
  ):
      """Adds a residual connection to the filter x for the shake-shake model."""
      curr_filters = common_layers.shape_list(x)[-1]
      if curr_filters == output_filters:
          return x
      stride_spec = [1, stride, stride, 1]
      # Skip path 1.
      path1 = tf.nn.avg_pool(x, [1, 1, 1, 1], stride_spec, "VALID")
      path1 = tf.layers.conv2d(
          path1,
          int(output_filters / 2),
          (1, 1),
          padding="SAME",
          name="path1_conv",
      )
  
      # Skip path 2.
      pad_arr = [
          [0, 0],
          [0, 1],
          [0, 1],
          [0, 0],
      ]  # First pad with 0's then crop.
      path2 = tf.pad(x, pad_arr)[:, 1:, 1:, :]
      path2 = tf.nn.avg_pool(path2, [1, 1, 1, 1], stride_spec, "VALID")
      path2 = tf.layers.conv2d(
          path2,
          int(output_filters / 2),
          (1, 1),
          padding="SAME",
          name="path2_conv",
      )
  
      # Concat and apply BN.
      final_path = tf.concat(values=[path1, path2], axis=-1)
      final_path = tf.layers.batch_normalization(
          final_path, training=is_training, name="final_path_bn"
      )
      return final_path
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.layers import common_layers
  from tensor2tensor.utils import hparam
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 1 for calling a global function with example usage: shake_shake_skip_connection(x, output_filters, stride, is_training) and returns: final_path, x