code: def _check(self, x):
      out, indices = functions.max_pooling_2d(
          x, 2, cover_all=False, return_indices=True
      )
      assert isinstance(out, chainer.Variable)
      assert isinstance(out.array, type(x))
      assert isinstance(indices, type(x))
      assert indices.shape == out.array.shape
  
      # Calculate expected indices.
      expect = numpy.zeros(indices.shape, dtype=indices.dtype)
      for i in six.moves.range(2):
          for c in six.moves.range(3):
              xx = x[i, c]
              expect[i, c] = numpy.array(
                  [
                      [
                          xx[0:2, 0:2].ravel().argmax(),
                          xx[0:2, 2:4].ravel().argmax(),
                      ],
                      [
                          xx[2:4, 0:2].ravel().argmax(),
                          xx[2:4, 2:4].ravel().argmax(),
                      ],
                  ]
              )
      if out.xp is cuda.cupy:
          expect = cuda.to_gpu(expect)
      assert (expect == indices).all()
  
imports: import unittest
  import numpy
  import six
  import chainer
  from chainer.backends import cuda
  from chainer import functions
  from chainer import testing
  from chainer.testing import attr
  from chainer.testing import backend
  from chainer_tests.functions_tests.pooling_tests import pooling_nd_helper
label_desc: Use image node_id 2 for calling the TestMaxPooling2DIndices obj's underlying member method code with example usage: obj._check(x) without return types