code: def superpixel_kernel_initializer(
      shape, dtype="float32", partition_info=None
  ):
      """Initializes superpixel kernels.
  
      This is inspired by space-to-depth transformation that is mathematically
      equivalent before and after the transformation. But we do the space-to-depth
      via a convolution. Moreover, we make the layer trainable instead of direct
      transform, we can initialization it this way so that the model can learn not
      to do anything but keep it mathematically equivalent, when improving
      performance.
  
  
      Args:
        shape: shape of variable
        dtype: dtype of variable
        partition_info: unused
  
      Returns:
        an initialization for the variable
      """
      del partition_info
      #  use input depth to make superpixel kernel.
      depth = shape[-2]
      filters = np.zeros([2, 2, depth, 4 * depth], dtype=dtype)
      i = np.arange(2)
      j = np.arange(2)
      k = np.arange(depth)
      mesh = np.array(np.meshgrid(i, j, k)).T.reshape(-1, 3).T
      filters[
          mesh[0], mesh[1], mesh[2], 4 * mesh[2] + 2 * mesh[0] + mesh[1]
      ] = 1
      return filters
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import functools
  import math
  from absl import logging
  import numpy
  import six
  from six.moves import xrange
  import tensorflow.compat.v1
  import utils
label_desc: Use image node_id 3 for calling a global function with example usage: superpixel_kernel_initializer(shape, dtype, partition_info) and returns: filters