def shaped_reverse_arange(shape, xp=cupy, dtype=numpy.float32):
    size = internal.prod(shape)
    a = numpy.arange(size, 0, -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 filled with decreasing numbers.
dataset/ETHPy150Open pfnet/chainer/cupy/testing/helper.py/shaped_reverse_arange