torchcell.knowledge_graphs.subset.subset_dataset

subset_dataset(dataset: Any, size: int | None, seed: int = 42, prefilter_indices: list[int] | None = None) → Any[source]

Return the dataset narrowed to a prefiltered pool, then randomly sampled.

prefilter_indices=None leaves the pool as the whole dataset; size=None takes the whole pool. With both unset the dataset is returned unchanged (the real build). The return is always the same dataset class – an index view, not a copy.