MCPcopy
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
158def 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_spmmFunction · 0.85
test_bspmmFunction · 0.85

Calls 1

cooMethod · 0.80

Tested by 2

test_spmmFunction · 0.68
test_bspmmFunction · 0.68