utils.CtxCachedObject
Get be used to get adjacency matrix on the provided ctx.
return utils.CtxCachedObject(lambda ctx : graph.adjacency_matrix(ctx=ctx))
def build_adj_matrix_index_uv(graph, edges, reduce_nodes):
Build adj matrix index and shape using the given (u, v) edges.
After Change
if shuffle is not required.
adjmat, shuffle_idx = graph._graph.adjacency_matrix(transpose=False, ctx=F.cpu())
return utils.CtxCachedObject(lambda ctx : F.copy_to(adjmat, ctx)), shuffle_idx
def _build_adj_matrix_index_uv(graph, edges, reduce_nodes):
Build adj matrix index and shape using the given (u, v) edges.