Metadata-Version: 2.4
Name: shrew_python
Version: 0.1.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
License-File: LICENSE
Summary: Python bindings for the Shrew deep learning library
Keywords: deep-learning,machine-learning,rust,neural-network,tensor
Home-Page: https://github.com/ginozza/shrew
Author-email: ginozza <jsimancas@unimagdalena.edu.co>
License: Apache-2.0
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://github.com/ginozza/shrew#readme
Project-URL: Homepage, https://github.com/ginozza/shrew
Project-URL: Repository, https://github.com/ginozza/shrew

# shrew-python

Python bindings for [Shrew](https://github.com/ginozza/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

```bash
pip install shrew-python
```

## Usage

```python
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](https://rustup.rs/) and [Maturin](https://github.com/PyO3/maturin).

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

## License

Apache-2.0

