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

Method has_nonzero

python/dgl/utils/internal.py:281–284  ·  view source on GitHub ↗

Check if there is any nonzero value in this Index

(self)

Source from the content-addressed store, hash-verified

279 return Index(mask, self.dtype)
280
281 def has_nonzero(self):
282 """Check if there is any nonzero value in this Index"""
283 tensor = self.tousertensor()
284 return F.sum(tensor, 0) > 0
285
286
287def toindex(data, dtype="int64"):

Callers

nothing calls this directly

Calls 1

tousertensorMethod · 0.95

Tested by

no test coverage detected