code: def check_col2im_nd(self, ksize, stride, pad, gpu):
      dims = self.dims
      outs = tuple(
          conv_nd.get_conv_outsize(d, k, s, p)
          for (d, k, s, p) in zip(dims, ksize, stride, pad)
      )
      col_shape = (2, 3) + ksize + outs
      col = numpy.random.uniform(-1, 1, col_shape).astype(numpy.float32)
  
      if gpu:
          col_data = cuda.to_gpu(col)
      else:
          col_data = col
  
      img = conv_nd.col2im_nd(col_data, stride, pad, dims)
      img = cuda.to_cpu(img)
      img_shape = (2, 3) + dims
      self.assertEqual(img.shape, img_shape)
      for n in moves.range(2):
          for c in moves.range(3):
              for xs in itertools.product(
                  *[moves.range(d) for d in dims]
              ):
                  v = numpy.float32(0.0)
                  for dxs in itertools.product(
                      *[moves.range(k) for k in ksize]
                  ):
                      oxs = tuple(
                          (x + p - dx) // s
                          for (x, p, dx, s) in zip(xs, pad, dxs, stride)
                      )
                      if all(
                          (x + p - dx) % s == 0
                          for (x, p, dx, s) in zip(xs, pad, dxs, stride)
                      ) and all(
                          0 <= ox < out for (ox, out) in zip(oxs, outs)
                      ):
                          col_index = (n, c) + dxs + oxs
                          v += col[col_index]
                  img_index = (n, c) + xs
                  self.assertAlmostEqual(img[img_index], v)
  
imports: import itertools
  import unittest
  import numpy
  from six import moves
  from chainer.backends import cuda
  from chainer import testing
  from chainer.testing import attr
  from chainer.utils import conv_nd
label_desc: Use image node_id 1 for calling the TestCol2ImND obj's underlying member method code with example usage: obj.check_col2im_nd(ksize, stride, pad, gpu) without return types