Graph storage and operations#

pylibwholegraph.torch.GraphStructure()

Graph structure storage Actually, it is the graph structure of one relation, represented in CSR format.

pylibwholegraph.torch.graph_ops.append_unique(...)

Append neighbor_node_tenosr to target_node_tensor, keep target_node_tensor unchanged and do unique e.g. if target_node_tensor is [3, 11, 2, 10], neighbor_node_tensor is [4, 5, 2, 11, 6, 9, 10, 5], output_unique_node may be [3, 11, 2, 10, 6, 4, 9, 5], order of 6, 4, 9, 5 may change.

pylibwholegraph.torch.graph_ops.add_csr_self_loop(...)

Add self loop to sampled CSR graph NOTE: this function will not check if there is already self loop in the raw CSR graph.

pylibwholegraph.torch.wholegraph_ops.unweighted_sample_without_replacement(...)

Unweighted neighborhood sample in CSR WholeGraph

pylibwholegraph.torch.wholegraph_ops.weighted_sample_without_replacement(...)

Weighted neighborhood sample in CSR WholeGraph