Skip to content

gather on a sparse source should return a dense array #625

Open
@CarloLucibello

Description

@CarloLucibello

This is the current behavior:

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

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

julia> A = sparse(s, t, [1.0, 1.0, 1.0], 3, 3)
3×3 SparseMatrixCSC{Float64, Int64} with 3 stored entries:
     1.0    
         1.0
 1.0        

julia> w = NNlib.gather(A, s, t)
3-element SparseVector{Float64, Int64} with 3 stored entries:
  [1]  =  1.0
  [2]  =  1.0
  [3]  =  1.0

I would expect w to be a dense vector instead.

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