tglite.TGraph¶
- class tglite.TGraph(edges: ndarray, times: ndarray, num_nodes: int = None)¶
A container for temporal graph and related tensor data. It initially stores temporal edges in COO format, sorted based on timestamp. While performing neighborhood sampling, it uses CSR format for faster lookups. TGLite automatically handles the construction and management of these graph formats without intervention from the user.
- __init__(edges: ndarray, times: ndarray, num_nodes: int = None)¶
Internal constructor for creating a TGraph
- Parameters:
edges (np.ndarray) –
times (np.ndarray) –
num_nodes (int) –
Query graph structure¶
Total number of nodes |
|
Total number of edges |
Query graph data¶
Returns edge feature |
|
Returns node feature |
|
Returns edge data |
|
Returns node data |
Query memory-based TGN data¶
Returns node memory |
|
Returns node mailbox |
Set device¶
Returns TGraph's storage device |
|
Returns TGraph's computing device |
|
|
Sets computing device |
|
Moves tensor data to device while keeping graph on CPU |