GraphBatch¶
-
class
caldera.data.
GraphBatch
(node_attr, edge_attr, global_attr, edges, node_idx, edge_idx)[source]¶ -
Methods
__init__
(node_attr, edge_attr, global_attr, …)allclose
(*args, **kwargs)append_edges
(edge_attr, edges, edge_idx)Append edges to the graph batch at the specified edge_idx (assumed to be sorted).
append_nodes
(node_attr, node_idx)- param node_attr
apply
(func, *args[, keys])Applies the function to the data, creating a new instance of GraphData.
apply_
(func, *args[, keys])Applies the function in place to the data, wihout creating a new instance of GraphData.
apply_edge_mask
(mask)Apply edge mask to the graph, returning a new
GraphData
instance.apply_edge_mask_
(mask)In place version of
caldera.data.GraphData.apply_edge_mask()
apply_node_mask
(node_mask)Apply node mask to the graph, returning a new
GraphData
instance, removing any edges if necessary.apply_node_mask_
(node_mask)In place version of
caldera.data.GraphData.apply_node_mask()
.clone
()Clones the data.
contiguous
()copy
([non_blocking])non_blocking (bool) – if True and this copy is between CPU and GPU, the copy may occur asynchronously with respect to the host.
debug
()density
()Return density of the graph.
detach
()disjoint_union
(other)Disjoint union between two GraphBatches.
from_data_list
(data_list)from_networkx
(*args, **kwargs)from_networkx_list
(graphs, *args, **kwargs)- param graphs
index_edges
(idx)Apply index to nodes.
index_edges_
(idx)In place version of
caldera.data.GraphData.index_edges()
index_nodes
(idx)Apply index to nodes.
index_nodes_
(idx)In place version of
caldera.data.GraphData.index_nodes()
info
()memsize
()Return total number of bytes in the.
nelement
()Return total number of elements in the.
random
(*args, **kwargs)random_batch
(size, n_feat, e_feat, g_feat[, …])- param size
reverse
()- rtype
GraphData
reverse_
()share_storage
(other[, return_dict])Check if this data shares storage with another data.
shuffle
()- rtype
GraphBatch
shuffle_
()- rtype
None
shuffle_edges
()- rtype
GraphData
shuffle_edges_
()- rtype
None
shuffle_graphs
()- rtype
GraphBatch
shuffle_graphs_
()- rtype
None
shuffle_nodes
()- rtype
GraphData
shuffle_nodes_
()- rtype
None
to
(device, *args, **kwargs)- param device
to_data_list
()- rtype
List
[GraphData
]
to_networkx
(*args, **kwargs)to_networkx_list
([feature_key, …])- param feature_key
view
([x_slice, e_slice, g_slice, edges_slice])- param x_slice
Attributes
e
edge_idx
edge_shape
edges
g
global_shape
node_idx
node_shape
num_edges
num_graphs
num_nodes
requires_grad
shape
size
x