Framework-agnostic library for loading data
Project description
dpshdl
A framework-agnostic library for loading data.
Installation
pip install dpshdl
Usage
Datasets should override a single method, next
, which returns a single sample.
import dpshdl as dl
import numpy as np
class MyDataset(dl.Dataset[np.ndarray, np.ndarray]):
def next(self) -> int:
return 1
def collate(self, items: list[int]) -> np.ndarray:
return np.array(items)
loader = dl.Dataloader(MyDataset(), batch_size=2)
# Loops forever.
for sample in loader:
assert sample.shape == (2,)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dpshdl-0.0.2.tar.gz
(20.8 kB
view hashes)
Built Distribution
dpshdl-0.0.2-py3-none-any.whl
(21.5 kB
view hashes)