PyTorch Pipeline: Simple ETL Pipeline for PyTorch
PyTorch Pipeline is a simple ETL framework for PyTorch. It is an alternative to tf.data in TensorFlow
Requirements
- Python 3.6+
- PyTorch 1.2+
Installation
To install PyTorch Pipeline:
pip install pytorch_pipeilne
Basic Usage
import pytorch_pipeilne as pp
d = pp.TextDataset('/path/to/your/text')
d.shuffle(buffer_size=100).batch(batch_size=10).first()
Usage with PyTorch
from torch.utils.data import DataLoader
import pytorch_pipeilne as pp
d = pp.Dataset(range(1_000)).parallel().shuffle(100).batch(10)
loader = DataLoader(d, num_workers=4, collate_fn=lambda x: x)
for x in loader:
...
Usage with LineFlow
You can use PyTorch Pipeline with pre-defined datasets in LineFlow:
from torch.utils.data import DataLoader
from lineflow.datasets.wikitext import cached_get_wikitext
import pytorch_pipeilne as pp
dataset = cached_get_wikitext('wikitext-2')
# Preprocessing dataset
train_data = pp.Dataset(dataset['train']) \
.flat_map(lambda x: x.split() + ['<eos>']) \
.window(35) \
.parallel() \
.shuffle(64 * 100) \
.batch(64)
# Iterating dataset
loader = DataLoader(train_data, num_workers=4, collate_fn=lambda x: x)
for x in loader:
...
Metadata
Release files for pytorch-pipeline 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pytorch-pipeline-0.0.1.tar.gz | 14.4 kB | Without provenance | Details for pytorch-pipeline-0.0.1.tar.gz |
Release files / pytorch-pipeline-0.0.1.tar.gz
| Download URL | pytorch-pipeline-0.0.1.tar.gz |
|---|---|
| Size | 14.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8c0c421aaf73cb279d5891d3e89f4527fbe144c5d1ee4f6967d4616a9f90a4a2
|
|
BLAKE2b-256 checksum How to use checksums |
3dbd4d2d422bdbba7836008ff35bec0b4682d6fd865db0991154d4dcb67862d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.7
|
Security for pytorch-pipeline 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.