Skip to content

nexuml.evaluation.storage

nexuml.evaluation.storage

Temporary storage helpers for evaluation algorithms.

AppendableTensorDictBuffer

Append TensorDict batches into temporary storage up to a fixed capacity.

ReservoirTensorDictBuffer

Reservoir-sample TensorDict rows into temporary storage.

create_temporary_storage

create_temporary_storage(
    backend: str = "memory",
    max_samples: int = 2000,
    storage_path: str | Path | None = None,
) -> _BaseTensorDictStorage

Create a temporary TensorDict storage backend.

Returns:

Type Description
_BaseTensorDictStorage

The requested _BaseTensorDictStorage instance.

Raises:

Type Description
ValueError

If backend is not "memory" or "memmap".