code: def im2col_nd(img, ksize, stride, pad, cover_all=False, dilate=1):
      fn = (
          im2col_nd_gpu
          if isinstance(img, cuda.ndarray)
          else im2col_nd_cpu
      )
      return fn(
          img, ksize, stride, pad, cover_all=cover_all, dilate=dilate
      )
  
file_path: chainer/chainer/utils/conv_nd.py
imports: import itertools
  import numpy
  import six
  from chainer.backends import cuda
  from chainer.utils.conv import get_conv_outsize
  from chainer.utils import conv_nd_kernel
label_desc: Use image node_id 4 for calling a global function with example usage: im2col_nd(img, ksize, stride, pad, cover_all, dilate) and returns: fn