GraphData¶
- 
class 
caldera.data.GraphData(node_attr, edge_attr, global_attr, edges, requires_grad=None)[source]¶ Data representing a single graph.
- Parameters
 node_attr (
FloatTensor) –edge_attr (
FloatTensor) –global_attr (
FloatTensor) –edges (
LongTensor) –requires_grad (
Optional[bool]) –
Blank.
- Parameters
 node_attr (
FloatTensor) –edge_attr (
FloatTensor) –global_attr (
FloatTensor) –edges (
LongTensor) –requires_grad (
Optional[bool]) –
- 
__init__(node_attr, edge_attr, global_attr, edges, requires_grad=None)[source]¶ Blank.
- Parameters
 node_attr (
FloatTensor) –edge_attr (
FloatTensor) –global_attr (
FloatTensor) –edges (
LongTensor) –requires_grad (
Optional[bool]) –
Methods
__init__(node_attr, edge_attr, global_attr, …)Blank.
allclose(other, **kwargs)- param other
 
append_edges(edge_attr, edges)- param edge_attr
 
append_nodes(node_attr)- 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
GraphDatainstance.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
GraphDatainstance, 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()from_networkx(g[, n_node_feat, n_edge_feat, …])Create a new
GraphDatafrom a networkx graph.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(n_feat, e_feat, g_feat[, …])- param n_feat
 
reverse()- rtype
 GraphData
reverse_()share_storage(other[, return_dict])Check if this data shares storage with another data.
shuffle()- rtype
 GraphData
shuffle_()- rtype
 None
shuffle_edges()- rtype
 GraphData
shuffle_edges_()- rtype
 None
shuffle_nodes()- rtype
 GraphData
shuffle_nodes_()- rtype
 None
to(device, *args, **kwargs)- param device
 
to_networkx([feature_key, global_attr_key, …])- param feature_key
 
view([x_slice, e_slice, g_slice])- param x_slice
 
Attributes
eedge_shapeedgesgglobal_shapenode_shapenum_edgesnum_graphsnum_nodesrequires_gradshapesizex