hoops_ai.storage.PyGGraphStoreHandler

class hoops_ai.storage.PyGGraphStoreHandler

Bases: MLStorage

append_edata(edge_features, feature_name, torch_type=torch.float)

Stores edge features on the Data object.

The primary edge feature (name ‘x’) is stored as edge_attr following PyG convention. Other names are stored as-is.

Parameters:
Return type:

None

append_extra_data(extra_data, feature_name, torch_type=torch.float)

Stores extra data in the extra_dict under the given name.

Parameters:
Return type:

None

append_ndata(node_features, feature_name, torch_type=torch.float)

Stores node features on the Data object under the given attribute name.

Parameters:
Return type:

None

concatenate_data(target_tensor, source_tensor)

Concatenates two tensors along the last dimension.

Parameters:
Return type:

torch.Tensor

file_extension()

File extension used when saving graphs.

Return type:

str

format()

Returns the storage format identifier.

Return type:

str

load_graph(filepath)

Loads a PyG Data object from a .pt file.

Parameters:

filepath (str)

Return type:

torch_geometric.data.Data

save_graph(filepath)

Saves the PyG Data object and extra dict to a .pt file.

Parameters:

filepath (str)

Return type:

None

setup_graph(source_nodes, target_nodes, num_nodes)

Creates a PyG Data object from edge lists and node count.

Parameters:
Return type:

None