MCPcopy Index your code
hub / github.com/dmlc/dgl / idx2mask

Function idx2mask

python/dgl/data/utils.py:382–386  ·  view source on GitHub ↗

Create mask.

(idx, len)

Source from the content-addressed store, hash-verified

380
381
382def idx2mask(idx, len):
383 """Create mask."""
384 mask = np.zeros(len)
385 mask[idx] = 1
386 return mask
387
388
389def generate_mask_tensor(mask):

Callers 3

add_nodepred_splitFunction · 0.85
mask_nodes_by_propertyFunction · 0.85
process_raw_tuplesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected