

def setUp(self):
    shape = (self.n, self.c, self.h, self.w)
    size = numpy.prod(shape)
    self.x = numpy.arange(size, dtype=numpy.float32).reshape(shape)
    numpy.random.shuffle(self.x)
    self.x += numpy.random.uniform(0.4, 0.6, shape).astype(numpy.float32)
    self.x /= size
    self.one = numpy.ones((self.n, self.c, self.h, self.w)).astype(numpy.float32)
    self.gy = numpy.random.uniform((- 1), 1, (self.n, self.output_dim, 1, 1))
    self.gy = self.gy.astype(numpy.float32)

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