Skip to content

Set API for Unwrapping of 1D/0D Scalars #160

Description

@ejmeitz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions