Skip to main content

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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

embeddedtorch-0.1.4.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

embeddedtorch-0.1.4-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

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

Hashes for embeddedtorch-0.1.4.tar.gz
Algorithm Hash digest
SHA256 889ca8cd7eabe25e69534b6d300a6021bbcd719ab6d5d2b03421cadc24a9ebef
MD5 aed013d4cf123f5d8acbc3078ecafa1c
BLAKE2b-256 9a59434a217a18e88d8edc412a3398e290026e47cbd6e8ca6c28eeaeeebad8c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for embeddedtorch-0.1.4.tar.gz:

Publisher: python-publish.yml on muazalamri/embeddedtorch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for embeddedtorch-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5f174c95d465b8ae2e36181467bee6dd4c4522ee7cfdf71fcd140d240ba3fc78
MD5 58bae3acdb9f1735a3aa3c683a63d249
BLAKE2b-256 527bde2f7ca58c5f71aefeb08bb046b4475fa0e51b66efcd11548f687c2d78b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for embeddedtorch-0.1.4-py3-none-any.whl:

Publisher: python-publish.yml on muazalamri/embeddedtorch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page