code: def CustomMultibitKernel(input, bit_map, mean_bits=None):
      if mean_bits:
          bit_map = np.asarray(
              np.maximum(
                  np.round(np.random.normal(mean_bits, 1, input.shape)),
                  1,
              ),
              dtype=np.int32,
          )
          print("Mean Bits: ", np.mean(bit_map))
      else:
          if type(bit_map) == int:
              length = C.reshape(input, (-1))
              bit_map = [bit_map] * length.shape[0]
              bit_map = np.asarray(bit_map)
              bit_map = bit_map.reshape(input.shape)
          else:
              bit_map = np.asarray(bit_map)
      assert bit_map.shape == input.shape
      return user_function(MultibitKernel(input, bit_map))
  
imports: from cntk import *
  from cntk.ops.functions import UserFunction
  import numpy
  import cntk
label_desc: Use image node_id 4 for calling a global function with example usage: CustomMultibitKernel(input, bit_map, mean_bits) and returns: user_function