code: def _compile_kx(self, ndim, outs, ks):
      # 2D: int kx_0 = i / (k_1 * out_0 * out_1) % k_0;
      #     int kx_1 = i / (out_0 * out_1) % k_1;
      def aux(kx, xs):
          head = xs[0]
          tail = xs[1:] + outs
          if tail:
              return "int {} = i / ({}) % {};".format(
                  kx, mulexp(tail), head
              )
          else:
              return "int {} = i % {};".format(kx, head)
  
      kxs = vars("kx", ndim)
      kx_decls = map_(aux, kxs, succ_sublists(ks))
      return kx_decls, kxs
  
imports: import functools
  import six
  from chainer.backends import cuda
label_desc: Use image node_id 4 for calling the Im2colNDKernel obj's underlying member method code with example usage: obj._compile_kx(ndim, outs, ks) and returns: kx_decls,  kxs, str, str