oa::data::HostDataset
Thread-shareable host dataset contract for PrefetchDataLoader. Runtime is !Send, so async prefetch runs on host values: worker threads index a HostDataset, collate host-side, and the consumer thread uploads each batch to the device — the same split as DataLoader(num_workers>0, pin_memory=True) in torch, where workers also produce host tensors.
Declaration
pub trait HostDataset: Send + Sync { // Required methods fn len(&self) -> i64; fn get_host_sample(&self, index: i64) -> Result<HostSample>; // Provided method fn is_empty(&self) -> bool { ... } }Public Rust declaration.