(ntype, v)
| 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) |
no test coverage detected