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.
from dpshdl.dataset import Dataset
from dpshdl.dataloader import Dataloader
import numpy as np
class MyDataset(Dataset[np.ndarray, np.ndarray]):
def next(self) -> int:
return 1
def collate(self, items: list[int]) -> np.ndarray:
return np.array(items)
loader = 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.5.tar.gz
(20.9 kB
view hashes)
Built Distribution
dpshdl-0.0.5-py3-none-any.whl
(21.5 kB
view hashes)