Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/dmlc/dgl
/ dense_mask
Function
dense_mask
tests/python/pytorch/sparse/utils.py:158–163 ·
view source on GitHub ↗
(dense, sparse)
Source
from the content-addressed store, hash-verified
156
157
158
def
dense_mask(dense, sparse):
159
ret = torch.zeros_like(dense)
160
row, col = sparse.coo()
161
for
r, c in zip(row, col):
162
ret[r, c] = dense[r, c]
163
return
ret
Callers
2
test_spmm
Function · 0.85
test_bspmm
Function · 0.85
Calls
1
coo
Method · 0.80
Tested by
2
test_spmm
Function · 0.68
test_bspmm
Function · 0.68