rllm.data.NodeStorage

class rllm.data.NodeStorage(initialdata: Dict[str, Any] | None = None, **kwargs)[source]

Bases: BaseStorage

A storage class for node attributes in a graph.

Parameters:
  • initialdata (Optional[Dict[str, Any]]) – Initial data to populate the storage.

  • **kwargs – Additional keyword arguments to populate the storage.

num_nodes

The number of nodes in the storage.

Type:

int

is_node_attr(key: str) bool[source]

Node attributes should be: 1. List, tuple, or TableData with length equal to the number of nodes. 2. Tensor with the first dimension equal to the number of nodes. 3. Numpy array with the first dimension equal to the number of nodes.