rllm.data.BaseStorage¶
- class rllm.data.BaseStorage(initialdata: Dict[str, Any] | None = None, **kwargs)[source]¶
Bases:
MutableMappingA base class for storing nodes or edges in a graph. This class wraps a Python dictionary and extends it as follows:
It allows attribute assignments, e.g.: storage.x = … in addition to storage[‘x’] = …
It allows private attributes that are not exposed to the user, e.g.: storage._{key} = … and accessible via storage._{key}
It holds an (optional) weak reference to its parent object, e.g.: storage._parent = weakref.ref(parent)
It adds additional PyTorch Tensor functionality, e.g.: storage.cpu(), storage.cuda().