def _mat_ptrs(a):
    if len(a) == 1:
        return cuda.cupy.full((1,), a.data.ptr, dtype=numpy.uintp)
    else:
        stride = a.strides[0]
        ptr = a.data.ptr
        return cuda.cupy.arange(ptr, ptr + stride * len(a), stride,
                                dtype=numpy.uintp)
Creates an array of pointers to matrices
dataset/ETHPy150Open pfnet/chainer/chainer/functions/math/matmul.py/_mat_ptrs