code: def multiFunc(self, arg1):
      # load or create the inputs we need
      multiIn = C.input(
          shape=arg1.shape, dynamic_axes=arg1.dynamic_axes
      )
      bit_map = C.constant(self.bit_map)
      max_bits = self.bit_map.max()
      shape = multiIn.shape
      reformed = C.reshape(multiIn, (-1,))
      # lets compute the means we need
      # carry over represents the remaining value that needs to binarized. For a single bit, this is just the input. For more bits,
      # it is the difference between the previous bits approximation and the true value.
      carry_over = multiIn
      approx = C.element_times(multiIn, 0)
      # iterate through the maximum number of bits specified by the bit maps, basically compute each level of binarization
      for i in range(max_bits):
          # determine which values of the input should be binarized to i bits or more
          hot_vals = C.greater(bit_map, i)
          # select only the values which we need to binarize
          valid_vals = C.element_select(hot_vals, carry_over, 0)
          # compute mean on a per kernel basis, reshaping is done to allow for sum reduction along only axis 0 (the kernels)
          mean = C.element_divide(
              C.reduce_sum(
                  C.reshape(
                      C.abs(valid_vals), (valid_vals.shape[0], -1)
                  ),
                  axis=1,
              ),
              C.reduce_sum(
                  C.reshape(hot_vals, (hot_vals.shape[0], -1)), axis=1
              ),
          )
          # reshape the mean to match the dimensionality of the input
          mean = C.reshape(mean, (mean.shape[0], mean.shape[1], 1, 1))
          # binarize the carry over
          bits = C.greater(carry_over, 0)
          bits = C.element_select(bits, bits, -1)
          bits = C.element_select(hot_vals, bits, 0)
          # add in the equivalent binary representation to the approximation
          approx = C.plus(approx, C.element_times(mean, bits))
          # compute the new carry over
          carry_over = C.plus(
              C.element_times(C.element_times(-1, bits), mean),
              carry_over,
          )
  
      return approx, multiIn
  
imports: from cntk import *
  from cntk.ops.functions import UserFunction
  import numpy
  import cntk
label_desc: Use image node_id 2 for calling the MultibitKernel obj's underlying member method code with example usage: obj.multiFunc(arg1) and returns: approx,  multiIn