-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
more control over array storage location returned by similar
#33361
Comments
Basically, we need a more fine-grained version of |
What properties do you want from a "dense" array? It seems like this is just a case of either wanting |
Yeah, in this particular case we mostly know what we don't want: not a sparse result if the input is sparse, not a Maybe this makes more sense if we contrast this with the situation where you want a dense array supposed to contain values from the same set as the input. We could have a series of properties (dense/sparse, same set/different set...) that you can combine. Most arrays would only define some cases, like they currently do with EDIT: I should have noted that one of the reasons to want this API in addition to having things work in a generic way is that we don't want Distances to depend on CuArray. That situation can probably happen with other packages too. |
I'm considering more the fact that you really just want an |
Yes, that's probably another way of saying "give me the most general kind of array", but still allowing it to live on the GPU. It's hard to design something without concrete examples, so maybe let's think about what to do with Maybe what's needed is actually:
Then we'll just have to ask for a non-sparse, non-pooled result to get a |
I guess potentially this is useful for any dense matrix that does not live on CPU RAM? and a related thing might be |
similar
There are plenty of other issues about getting more control over similar (e.g., #18161). I think this one is worth keeping open due to its targeted use-case for GPU/accelerator storage types. |
similar
similar
For
res = f(x::AbstractArray)
, we'd like a method to get "similar but dense" (@maleadt) version ofx
, so one can implement it aswhere
f!(res, x)
is the inplace version off
.This is useful if
x
is aCuArray
,SparseArrays
orPooledArray
(@nalimilan) but such a function lacks now.Related issue: JuliaStats/Distances.jl#142
The text was updated successfully, but these errors were encountered: