

def check_forward_ones(self, x_data, use_cudnn=True):
    x = chainer.Variable(x_data)
    y = functions.spatial_pyramid_pooling_2d(x, self.pyramid_height, self.pooling_class, use_cudnn=use_cudnn)
    y_data = cuda.to_cpu(y.data)
    self.assertEqual((self.n, self.output_dim, 1, 1), y_data.shape)
    gradient_check.assert_allclose(y_data, numpy.ones_like(y_data))

dataset/ETHPy150Open pfnet/chainer/tests/chainer_tests/functions_tests/pooling_tests/test_spatial_pyramid_pooling_2d.py TestSpatialPyramidPooling2D.check_forward_ones/original