Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/arrayfire/arrayfire
/ makeSparse
Function
makeSparse
test/sparse_common.hpp:33–37 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
31
32
template<typename T>
33
static af::array makeSparse(af::array A, int factor) {
34
A = floor(A * 1000);
35
A = A * ((A % factor) == 0) / 1000;
36
return A;
37
}
38
39
template<>
40
af::array makeSparse<cfloat>(af::array A, int factor) {
Callers
nothing calls this directly
Calls
1
floor
Function · 0.85
Tested by
no test coverage detected