All reductions return 0D or 1D NDArrays currently instead of Julia scalars. This means that things like
arr = cuNumeric.ones(5)
if all(arr)
...
end
do not work because all(arr) is not a Bool.
We have functions like unwrap and Base.only which materialize the result.
It might also be possible to define convert functions so that if a user tries to pass a 1D/0D NDArray to a function expecting a scalar we can auto-convert it.
All reductions return 0D or 1D NDArrays currently instead of Julia scalars. This means that things like
do not work because
all(arr)is not aBool.We have functions like
unwrapandBase.onlywhich materialize the result.It might also be possible to define
convertfunctions so that if a user tries to pass a 1D/0D NDArray to a function expecting a scalar we can auto-convert it.