code: def resnet_shortcut(l, n_out, stride, activation=tf.identity):
      data_format = get_arg_scope()["Conv2D"]["data_format"]
      n_in = l.get_shape().as_list()[
          1 if data_format in ["NCHW", "channels_first"] else 3
      ]
      if n_in != n_out:  # change dimension when channel is not the same
          return Conv2D(
              "convshortcut",
              l,
              n_out,
              1,
              strides=stride,
              activation=activation,
          )
      else:
          return l
  
file_path: tensorpack/examples/ResNet/resnet_model.py
imports: import tensorflow
  from tensorpack import tfv1
  from tensorpack.models import BatchNorm, BNReLU, Conv2D, FullyConnected, GlobalAvgPooling, MaxPooling
  from tensorpack.tfutils.argscope import argscope, get_arg_scope
label_desc: Use image node_id 1 for calling a global function with example usage: resnet_shortcut(l, n_out, stride, activation) and returns: Conv2D, l