Skip to main content

shrew-python

Python bindings for Shrew, a modular deep learning framework written in Rust.

Features

  • High Performance: Native Rust implementation with minimal Python overhead.
  • GPU Support: CUDA acceleration via shrew-cuda (if valid CUDA toolkit is present).
  • Declarative Models: Full support for Shrew's .sw intermediate representation.
  • Autograd: Reverse-mode automatic differentiation.
  • Interoperability: Zero-copy tensor conversion from/to NumPy.

Installation

pip install shrew-python

Usage

import shrew_python as shrew

# Create tensors
x = shrew.tensor([1.0, 2.0, 3.0])
y = shrew.tensor([4.0, 5.0, 6.0])

# Operations
z = x + y
print(z)  # Tensor([5.0, 7.0, 9.0], dtype=F64, dev=Cpu)

# Load a .sw model
executor = shrew.Executor.load("my_model.sw")
result = executor.run("forward", {"input": x})

Building from Source

Requires Rust and Maturin.

git clone https://github.com/ginozza/shrew
cd shrew
maturin develop --manifest-path crates/shrew-python/Cargo.toml --release

License

Apache-2.0

Metadata

Release files for shrew-python 0.1.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 shrew-python 0.1.0
File Size Uploaded Provenance Actions
shrew_python-0.1.0.tar.gz 369.9 kB Without provenance Details for shrew_python-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for shrew-python 0.1.0
File Interpreter ABI Platform Actions
shrew_python-0.1.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for shrew_python-0.1.0-cp314-cp314-win_amd64.whl

Total release size: 1.5 MB

Release files / shrew_python-0.1.0.tar.gz

Download URL shrew_python-0.1.0.tar.gz
Size 369.9 kB
Tags Source
SHA-256 checksum
How to use checksums
78f3d5ad430047f3e48579abd44f972d566fd7df65b6ef65f7f261da2049818f
BLAKE2b-256 checksum
How to use checksums
d2c4ec34a229a4c90283c947319a38136d1fc5dc12267a6afdd790aa04487fad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.12.2

Release files / shrew_python-0.1.0-cp314-cp314-win_amd64.whl

Download URL shrew_python-0.1.0-cp314-cp314-win_amd64.whl
Size 1.1 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
25e96d6be85e973a41894f51f6ab580fc46cc4bffb892e6df8dd725572231376
BLAKE2b-256 checksum
How to use checksums
9ab65526222467acf81faacc46275bc7f725c4883b408fa5562d921ea169bba8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.12.2

Security for shrew-python 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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