code: def resnet_shortcut(l, n_out, stride, activation=tf.identity):
      n_in = l.shape[1]
      if n_in != n_out:  # change dimension when channel is not the same
          # TF's SAME mode output ceil(x/stride), which is NOT what we want when x is odd and stride is 2
          # In FPN mode, the images are pre-padded already.
          if not cfg.MODE_FPN and stride == 2:
              l = l[:, :, :-1, :-1]
          return Conv2D(
              "convshortcut",
              l,
              n_out,
              1,
              strides=stride,
              activation=activation,
          )
      else:
          return l
  
imports: import numpy
  import tensorflow
  from contextlib import ExitStack, contextmanager
  from tensorpack import tfv1
  from tensorpack.models import BatchNorm, Conv2D, MaxPooling, layer_register
  from tensorpack.tfutils import argscope
  from tensorpack.tfutils.scope_utils import auto_reuse_variable_scope
  from tensorpack.tfutils.varreplace import custom_getter_scope, freeze_variables
  from config import config
label_desc: Use image node_id 7 for calling a global function with example usage: resnet_shortcut(l, n_out, stride, activation) and returns: Conv2D, l