Tiny neural network runtime for microcontrollers and computers inspired by PyTorch
Project description
EmbeddedTorch
Convert your PyTorch models to embedded C++ code
EmbeddedTorch is a powerful Python library that allows you to convert PyTorch neural network models into optimized C++ code for deployment in embedded systems, microcontrollers, and resource-constrained environments.
Key Features
- 🚀 Easy Conversion: Convert PyTorch models to C++ with simple Python API
- 📦 Comprehensive Layers: Support for linear, convolutional, pooling, normalization, and activation layers
- ⚙️ Operations: Rich set of mathematical and tensor operations
- 🎯 Type-Safe: Support for different data types (float32, float64, etc.)
- 🔧 Flexible: Custom layer definitions and model composition support
- 🏗️ Production-Ready: Generate clean, optimized C++ code
Quick Start
from embeddedtorch.layers import EmbaeddableModel, LinearLayer
import torch
# Create a model
model = EmbaeddableModel(torch.float32)
model.add_layer(LinearLayer(10, 5, dtype=torch.float32))
model.add_layer(LinearLayer(5, 2, dtype=torch.float32))
# Generate C++ code
write_dep()
with open("out/code.cpp", "w", encoding="utf-8") as f:
print(cpp_code(model.list), file=f)
Documentation
- Getting Started - Installation and basic usage
- API Reference - Detailed API documentation
- Layers - Available layer types and usage
- Operations - Mathematical operations
- Examples - Complete working examples
Get Started
Ready to convert your PyTorch models to C++? Check out the Getting Started guide.
Installation
pip install embeddedtorch
License
MIT License - See LICENSE file for details
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file embeddedtorch-0.1.4.tar.gz.
File metadata
- Download URL: embeddedtorch-0.1.4.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
889ca8cd7eabe25e69534b6d300a6021bbcd719ab6d5d2b03421cadc24a9ebef
|
|
| MD5 |
aed013d4cf123f5d8acbc3078ecafa1c
|
|
| BLAKE2b-256 |
9a59434a217a18e88d8edc412a3398e290026e47cbd6e8ca6c28eeaeeebad8c6
|
Provenance
The following attestation bundles were made for embeddedtorch-0.1.4.tar.gz:
Publisher:
python-publish.yml on muazalamri/embeddedtorch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
embeddedtorch-0.1.4.tar.gz -
Subject digest:
889ca8cd7eabe25e69534b6d300a6021bbcd719ab6d5d2b03421cadc24a9ebef - Sigstore transparency entry: 708991862
- Sigstore integration time:
-
Permalink:
muazalamri/embeddedtorch@7b52694211fa095ea4c015442176a57537dff1ec -
Branch / Tag:
refs/tags/V1.0.4 - Owner: https://github.com/muazalamri
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@7b52694211fa095ea4c015442176a57537dff1ec -
Trigger Event:
release
-
Statement type:
File details
Details for the file embeddedtorch-0.1.4-py3-none-any.whl.
File metadata
- Download URL: embeddedtorch-0.1.4-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f174c95d465b8ae2e36181467bee6dd4c4522ee7cfdf71fcd140d240ba3fc78
|
|
| MD5 |
58bae3acdb9f1735a3aa3c683a63d249
|
|
| BLAKE2b-256 |
527bde2f7ca58c5f71aefeb08bb046b4475fa0e51b66efcd11548f687c2d78b3
|
Provenance
The following attestation bundles were made for embeddedtorch-0.1.4-py3-none-any.whl:
Publisher:
python-publish.yml on muazalamri/embeddedtorch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
embeddedtorch-0.1.4-py3-none-any.whl -
Subject digest:
5f174c95d465b8ae2e36181467bee6dd4c4522ee7cfdf71fcd140d240ba3fc78 - Sigstore transparency entry: 708991865
- Sigstore integration time:
-
Permalink:
muazalamri/embeddedtorch@7b52694211fa095ea4c015442176a57537dff1ec -
Branch / Tag:
refs/tags/V1.0.4 - Owner: https://github.com/muazalamri
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@7b52694211fa095ea4c015442176a57537dff1ec -
Trigger Event:
release
-
Statement type: