Skip to content

onehotbatch(::CuArray, ...) moves data to host #16

Open
@mcabbott

Description

@mcabbott

The lack of FluxML/Flux.jl#1959 causes the following error, currently blocking FluxML/Flux.jl#2025 :

julia> using CUDA, OneHotArrays, NNlibCUDA

julia> CUDA.allowscalar(false)

julia> x = [1, 3, 2];

julia> y = onehotbatch(x, (0,1,2,3))
4×3 OneHotMatrix(::Vector{UInt32}) with eltype Bool:
     
 1    
     1
   1  

julia> y2 = onehotbatch(x |> cu, (0,1,2,3))
ERROR: Scalar indexing is disallowed.

Edit: after #27, onehotbatch(x |> cu, 0:3) works, but other ways to specify the labels do not.

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