code: def load_weights_padded(
      mdl, idx, tensor_out_c, tensor_in_c, weight_s
  ):
      tensor_out_cg = (tensor_out_c + 3) // 4
      tensor_in_cg = (tensor_in_c + 3) // 4
      # weight & bias load & fixup
      # a reminder:
      #  [outputChannels][inputChannels][kernelH][kernelW]
      # ->
      #  [outputCGroups][kernelH][kernelW][inputCGroups][outputChannels][inputChannels]
      weight_na = load_param(
          mdl, idx, tensor_out_c * tensor_in_c * weight_s * weight_s
      )
      # start by putting in the initial shape
      weight_na = weight_na.reshape(
          tensor_out_c, tensor_in_c, weight_s, weight_s
      )
      # then by padding
      # NOTE: It is *critically important* that weight padding is done with the "zero" mode.
      # The shader WILL NOT ignore these values, but zeroing them causes them to have no effect.
      if (tensor_in_c & 3) != 0:
          weight_na = numpy.pad(
              weight_na,
              [[0, 0], [0, 4 - (tensor_in_c & 3)], [0, 0], [0, 0]],
              mode="constant",
          )
      if (tensor_out_c & 3) != 0:
          weight_na = numpy.pad(
              weight_na,
              [[0, 4 - (tensor_out_c & 3)], [0, 0], [0, 0], [0, 0]],
              mode="constant",
          )
      # reshape to finish splitting things up
      weight_na = weight_na.reshape(
          tensor_out_cg, 4, tensor_in_cg, 4, weight_s, weight_s
      )
      # result is:
      # [outputCGroups][outputChannels][inputCGroups][inputChannels][kernelH][kernelW]
      # and move output channels to the right...
      weight_na = numpy.moveaxis(weight_na, 1, 5)
      # result is:
      # [outputCGroups][inputCGroups][inputChannels][kernelH][kernelW][outputChannels]
      # and move input channels to the right...
      weight_na = numpy.moveaxis(weight_na, 2, 5)
      # result is:
      # [outputCGroups][inputCGroups][kernelH][kernelW][outputChannels][inputChannels]
      # and move input cgroups to the right...
      weight_na = numpy.moveaxis(weight_na, 1, 3)
      return weight_na
  
file_path: kompute/examples/neural_network_vgg7/sh_common.py
imports: from PIL import Image
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: load_weights_padded(mdl, idx, tensor_out_c, tensor_in_c, weight_s) and returns: weight_na