code: def preactivation_block(input, num_filters, stride=1):
      num_filters_in = input.get_shape().as_list()[1]
  
      # residual
      net = BNReLU(input)
      residual = Conv2D(
          "conv1",
          net,
          num_filters,
          kernel_size=3,
          strides=stride,
          use_bias=False,
          activation=BNReLU,
      )
      residual = Conv2D(
          "conv2",
          residual,
          num_filters,
          kernel_size=3,
          strides=1,
          use_bias=False,
      )
  
      # identity
      shortcut = input
      if stride != 1 or num_filters_in != num_filters:
          shortcut = Conv2D(
              "shortcut",
              net,
              num_filters,
              kernel_size=1,
              strides=stride,
              use_bias=False,
          )
  
      return shortcut + residual
  
file_path: tensorpack/examples/ResNet/cifar10-preact18-mixup.py
imports: import argparse
  import numpy
  import os
  from tensorpack import *
  from tensorpack.compat import tfv1
  from tensorpack.dataflow import dataset
  from tensorpack.tfutils.summary import *
label_desc: Use image node_id 1 for calling a global function with example usage: preactivation_block(input, num_filters, stride) and returns: unknown