Skip to content

more control over array storage location returned by similar #33361

Open
@xukai92

Description

@xukai92

For res = f(x::AbstractArray), we'd like a method to get "similar but dense" (@maleadt) version of x, so one can implement it as

function f(x::AbstractArray)
    res = similar_but_dense(x)
    f!(res, x)
end

where f!(res, x) is the inplace version of f.

This is useful if x is a CuArray, SparseArrays or PooledArray (@nalimilan) but such a function lacks now.

Related issue: JuliaStats/Distances.jl#142

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrays[a, r, r, a, y, s]gpuAffects running Julia on a GPU

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions