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

Function _process_nodes

python/dgl/subgraph.py:149–155  ·  view source on GitHub ↗
(ntype, v)

Source from the content-addressed store, hash-verified

147 nodes = {graph.ntypes[0]: nodes}
148
149 def _process_nodes(ntype, v):
150 if F.is_tensor(v) and F.dtype(v) == F.bool:
151 return F.astype(
152 F.nonzero_1d(F.copy_to(v, graph.device)), graph.idtype
153 )
154 else:
155 return utils.prepare_tensor(graph, v, 'nodes["{}"]'.format(ntype))
156
157 nodes = {ntype: _process_nodes(ntype, v) for ntype, v in nodes.items()}
158 device = context_of(nodes)

Callers 1

node_subgraphFunction · 0.85

Calls 4

formatMethod · 0.80
dtypeMethod · 0.45
astypeMethod · 0.45
copy_toMethod · 0.45

Tested by

no test coverage detected