code: def build_graph(self, image, label):
      assert tf.test.is_gpu_available()
  
      MEAN_IMAGE = tf.constant(
          [0.4914, 0.4822, 0.4465], dtype=tf.float32
      )
      STD_IMAGE = tf.constant(
          [0.2023, 0.1994, 0.2010], dtype=tf.float32
      )
      image = ((image / 255.0) - MEAN_IMAGE) / STD_IMAGE
      image = tf.transpose(image, [0, 3, 1, 2])
  
      pytorch_default_init = tf.variance_scaling_initializer(
          scale=1.0 / 3, mode="fan_in", distribution="uniform"
      )
      with argscope(
          [Conv2D, BatchNorm, GlobalAvgPooling],
          data_format="channels_first",
      ), argscope(Conv2D, kernel_initializer=pytorch_default_init):
          net = Conv2D(
              "conv0",
              image,
              64,
              kernel_size=3,
              strides=1,
              use_bias=False,
          )
          for i, blocks_in_module in enumerate(MODULE_SIZES):
              for j in range(blocks_in_module):
                  stride = 2 if j == 0 and i > 0 else 1
                  with tf.variable_scope("res%d.%d" % (i, j)):
                      net = preactivation_block(
                          net, FILTER_SIZES[i], stride
                      )
          net = GlobalAvgPooling("gap", net)
          logits = FullyConnected(
              "linear",
              net,
              CLASS_NUM,
              kernel_initializer=tf.random_normal_initializer(
                  stddev=1e-3
              ),
          )
  
      ce_cost = tf.nn.softmax_cross_entropy_with_logits(
          labels=label, logits=logits
      )
      ce_cost = tf.reduce_mean(ce_cost, name="cross_entropy_loss")
  
      single_label = tf.cast(tf.argmax(label, axis=1), tf.int32)
      wrong = tf.cast(
          tf.logical_not(tf.nn.in_top_k(logits, single_label, 1)),
          tf.float32,
          name="wrong_vector",
      )
      # monitor training error
      add_moving_summary(
          tf.reduce_mean(wrong, name="train_error"), ce_cost
      )
      add_param_summary((".*/W", ["histogram"]))
  
      # weight decay on all W matrixes. including convolutional layers
      wd_cost = tf.multiply(
          WEIGHT_DECAY,
          regularize_cost(".*", tf.nn.l2_loss),
          name="wd_cost",
      )
  
      return tf.add_n([ce_cost, wd_cost], name="cost")
  
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 2 for calling the ResNet_Cifar obj's underlying member method code with example usage: obj.build_graph(image, label) and returns: tf