MCPcopy
hub / github.com/dmlc/dgl / nonzero

Method nonzero

python/dgl/utils/internal.py:275–279  ·  view source on GitHub ↗

Return the nonzero positions

(self)

Source from the content-addressed store, hash-verified

273 return Index(tensor, self.dtype)
274
275 def nonzero(self):
276 """Return the nonzero positions"""
277 tensor = self.tousertensor()
278 mask = F.nonzero_1d(tensor != 0)
279 return Index(mask, self.dtype)
280
281 def has_nonzero(self):
282 """Check if there is any nonzero value in this Index"""

Callers 15

to_heterogeneousFunction · 0.80
_locate_eids_to_excludeFunction · 0.80
_reduce_gradFunction · 0.80
nonzero_1dFunction · 0.80
_reduce_gradFunction · 0.80
_reduce_gradFunction · 0.80
nonzero_1dFunction · 0.80
process_requestMethod · 0.80
_split_by_trainer_idFunction · 0.80
processMethod · 0.80
_load_graphMethod · 0.80
loadMethod · 0.80

Calls 2

tousertensorMethod · 0.95
IndexClass · 0.85

Tested by 13

check_sortFunction · 0.64
test_partition_with_haloFunction · 0.64
check_metis_partitionFunction · 0.64
test_compactFunction · 0.64
test_sample_rowwiseFunction · 0.64
test_sample_columnwiseFunction · 0.64
test_reduce_alongFunction · 0.64
test_splitFunction · 0.64
test_split_evenFunction · 0.64