code: def small_recording_to_training_resnet(
      image, config, test=False, channel_last=False, name="bn-graph-ref"
  ):
      axes = get_channel_axes(image, channel_last)
      rm = config.round_mode
      nr = config.narrow_range
      dt = config.dtype
      sx, zpx, sw, zpw, sb, zpb = None, None, None, None, None, None
      get_scale_zeropoint = (
          config.recorder_activation.get_scale_zeropoint
      )
  
      h = image
  
      # x->Q
      sx, zpx = get_scale_zeropoint(
          h, axes=axes, narrow_range=nr, name="s"
      )
      if sx is None:
          shape = [1] * h.ndim
          name = "s"
          sx, zpx = get_fake_quantization_parameter(shape, name)
  
      h = F.quantize_linear(h, sx, zpx, rm, nr, dt)
  
      with nn.parameter_scope("first-conv"):
          # Q->x->D
          h = F.dequantize_linear(h, sx, zpx)
          w, b = create_conv_weight_bias(
              h, 16, kernel=(3, 3), channel_last=channel_last, name=name
          )
          # Q->w->D
          sw, zpw = get_scale_zeropoint(
              w, axes=axes, narrow_range=nr, name="sw"
          )
          if sw is None:
              shape = [1] * w.ndim
              name = "sw"
              sw, zpw = get_fake_quantization_parameter(shape, name)
  
          w = F.quantize_linear(w, sw, zpw, rm, nr, dt)
          w = F.dequantize_linear(w, sw, zpw)
  
          # Q->b->D
          sb = sx.reshape([1]) * sw.reshape([1])
          sb = nn.Variable.from_numpy_array(sb.d)
          zpb = zpx.reshape([1])
          zpb = nn.Variable.from_numpy_array(zpb.d)
          b = F.quantize_linear(b, sb, zpb, rm, nr, dt)
          b = F.dequantize_linear(b, sb, zpb)
  
          # D->F->Q
          h = F.convolution(
              h,
              w,
              b,
              pad=(1, 1),
              stride=(1, 1),
              channel_last=channel_last,
          )
          sx, zpx = get_scale_zeropoint(
              h, axes=axes, narrow_range=nr, name="s"
          )
          if sx is None:
              shape = [1] * h.ndim
              name = "s"
              sx, zpx = get_fake_quantization_parameter(shape, name)
          h = F.quantize_linear(h, sx, zpx, rm, nr, dt)
      with nn.parameter_scope("ReLU-2"):
          # D->F->Q
          h = F.dequantize_linear(h, sx, zpx)
          h = F.relu(h)
          sx, zpx = get_scale_zeropoint(
              h, axes=axes, narrow_range=nr, name="s"
          )
          if sx is None:
              shape = [1] * h.ndim
              name = "ReLU-2/s"
              sx, zpx = get_fake_quantization_parameter(shape, name)
          h = F.quantize_linear(h, sx, zpx, rm, nr, dt)
      with nn.parameter_scope("MaxPooling-3"):
          # D->F->Q
          h = F.dequantize_linear(h, sx, zpx)
          h = F.max_pooling(h, (2, 2), channel_last=channel_last)
          sx, zpx = get_scale_zeropoint(
              h, axes=axes, narrow_range=nr, name="s"
          )
          if sx is None:
              shape = [1] * h.ndim
              name = "MaxPooling-3/s"
              sx, zpx = get_fake_quantization_parameter(shape, name)
          h = F.quantize_linear(h, sx, zpx, rm, nr, dt)
      h, sx, zpx = recording_to_training_resblock(
          h,
          config,
          16,
          sx,
          zpx,
          test=test,
          channel_last=channel_last,
          name="cb1",
      )
      h, sx, zpx = recording_to_training_resblock(
          h,
          config,
          16,
          sx,
          zpx,
          test=test,
          channel_last=channel_last,
          name="cb2",
      )
      h, sx, zpx = recording_to_training_resblock(
          h,
          config,
          16,
          sx,
          zpx,
          test=test,
          channel_last=channel_last,
          name="cb3",
      )
      h, sx, zpx = recording_to_training_resblock(
          h,
          config,
          16,
          sx,
          zpx,
          test=test,
          channel_last=channel_last,
          name="cb4",
      )
  
      with nn.parameter_scope("AveragePooling-16"):
          # D->F->Q
          h = F.dequantize_linear(h, sx, zpx)
          h = F.average_pooling(h, (2, 2), channel_last=channel_last)
          sx, zpx = get_scale_zeropoint(
              h, axes=axes, narrow_range=nr, name="s"
          )
          if sx is None:
              shape = [1] * h.ndim
              name = "AveragePooling-16/s"
              sx, zpx = get_fake_quantization_parameter(shape, name)
          h = F.quantize_linear(h, sx, zpx, rm, nr, dt)
      with nn.parameter_scope("fc"):
          # Q->x->D
          h = F.dequantize_linear(h, sx, zpx)
          w, b = create_affine_weight_bias(h, 10, name=name)
  
          # Q->w->D
          sw, zpw = get_scale_zeropoint(
              w, axes=axes, narrow_range=nr, name="w"
          )
          if sw is None:
              shape = [1] * w.ndim
              name = "fc/sw"
              sw, zpw = get_fake_quantization_parameter(shape, name)
          w = F.quantize_linear(w, sw, zpw, rm, nr, dt)
          w = F.dequantize_linear(w, sw, zpw)
  
          # Q->b->D
          sb = sx.reshape([1]) * sw.reshape([1])
          sb = nn.Variable.from_numpy_array(sb.d)
          zpb = zpx.reshape([1])
          zpb = nn.Variable.from_numpy_array(zpb.d)
          b = F.quantize_linear(b, sb, zpb, rm, nr, dt)
          b = F.dequantize_linear(b, sb, zpb)
  
          # D->F->Q
          pred = F.affine(h, w, b)
          return pred
  
imports: from __future__ import absolute_import
  import nnabla
  import nnabla.functions
  import nnabla.parametric_functions
  from .helper import create_scale_bias, create_conv_weight_bias, create_affine_weight_bias, get_channel_axes
label_desc: Use image node_id 41 for calling a global function with example usage: small_recording_to_training_resnet(image, config, test, channel_last, name) and returns: pred