syft.core.store.store_memory¶
Classes
Class that implements an in-memory ObjectStorage, backed by a dict. |
- class syft.core.store.store_memory.MemoryStore[source]¶
Bases:
syft.core.store.store_interface.ObjectStore
Class that implements an in-memory ObjectStorage, backed by a dict.
- _objects¶
the dict that backs the storage of the MemoryStorage.
- Type
dict
- _search_engine¶
the objects that handles searching by using tags or
- Type
ObjectSearchEngine
- description.
- keys()[source]¶
Method to return all indexes from the store.
- Returns
an iterable containing the keys of the store.
- Return type
Iterable[UID]
- values()[source]¶
Method to return all values from the store.
- Returns
an iterable containing the keys of the store.
- Return type
Iterable[StorableObject]
- delete(key)[source]¶
We should write custom deletion code so we can check if the item exists and then ensure deletion is called at a single place and that full __delitem__ is used where possible instead of the weaker del ref count. Also, care needs to be taken to not capture the deleted item in the Exception stack trace so it doesn’t keep the item around longer.
Method to remove an object from the store based on its UID.
- Parameters
key (UID) – the key at which to delete the object.
- Raises
ValueError – if the key is not present in the store.