def shaped_arange(shape, xp=cupy, dtype=numpy.float32):
    a = numpy.arange(1, internal.prod(shape) + 1, 1)
    if numpy.dtype(dtype).type == numpy.bool_:
        return xp.array((a % 2 == 0).reshape(shape))
    else:
        return xp.array(a.astype(dtype).reshape(shape))
Returns an array with given shape, array module, and dtype.
dataset/ETHPy150Open pfnet/chainer/cupy/testing/helper.py/shaped_arange