Skip to main content

silver-torch

An optional PyTorch layer for Silver. It turns a small Silver preprocessing program into a fitted, inspectable, reusable tensor and DataLoader pipeline.

pip install silver-data
pip install 'silver-torch[pytorch]'
from silver_data import Dataset
from silver_torch import compile_silver

program = """
pipeline ieee_inverse:
  features voltage, current, phase, sensor
  categorical sensor
  label fault
  architecture transformer
  sequence_length 2
  scaling standard
  missing median
  label_type classification
  batch_size 128
  num_workers 2
  cache_dir .cache/ieee_inverse
"""

dataset = Dataset.from_records("ieee", [
    {"voltage": 1.0, "current": 2.0, "phase": 0.2, "fault": 0},
    {"voltage": 1.2, "current": 2.1, "phase": 0.3, "fault": 1},
])
splits = dataset.split(0.8, 0.1, 0.1)
pipeline = compile_silver(program).fit(splits.train.records())
loader = pipeline.dataloader(splits.validation.records(), device="cuda")
print(pipeline.plan(device="cuda").to_dict())
print(pipeline.benchmark(splits.validation.records(), steps=20))

The compiler has explicit research-safety boundaries:

  • statistics and vocabularies are fitted only on splits.train;
  • missing columns, non-finite numbers, invalid labels, and incompatible sequence lengths fail loudly;
  • categorical vocabularies are sorted for reproducibility and reserve index 0 for unknown values;
  • classification targets are torch.long; regression targets use the chosen floating dtype;
  • cache keys include the fitted-training fingerprint and transformed rows, and cache writes are atomic;
  • loaders are seeded and tune pinning, persistent workers, prefetching, and drop_last based on the declared runtime.

The emitted shapes are [batch, features] for MLP, [batch, 1, features] for CNN, and [batch, sequence_length, features_per_step] for RNN/Transformer. These are layout contracts, not model implementations. Measure with benchmark() on the target machine; input speedups depend on storage, CPU, worker count, batch size, and accelerator.

Metadata

Release files for silver-torch 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for silver-torch 0.4.0
File Size Uploaded
silver_torch-0.4.0.tar.gz 12.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for silver-torch 0.4.0
File Interpreter ABI Platform
silver_torch-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.7 kB

Release files / silver_torch-0.4.0.tar.gz

Download URL silver_torch-0.4.0.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
abb5961289f0e0046f08688d6cab373dc8576f297ebb97b3849e6538ca6bbffb
BLAKE2b-256 checksum
How to use checksums
082dfb61636795e1b4f3d52e1e1edc2d4976d415cb00a6c13eb0c63c4f68dcd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 22, 2026.

Transparency log

Release files / silver_torch-0.4.0-py3-none-any.whl

Download URL silver_torch-0.4.0-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e1296c21190228c28fcd6566437aad18109564e41c4fe1c7cd7350bf37f1417
BLAKE2b-256 checksum
How to use checksums
a1dc911bcd3373ebc12ac17eb9f84aaf6b21966452db95f045df0c02d39c78da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 22, 2026.

Transparency log

Release history Release notifications | RSS feed

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page