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 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.3.tar.gz (8.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.3-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file embeddedtorch-0.1.3.tar.gz.

File metadata

  • Download URL: embeddedtorch-0.1.3.tar.gz
  • Upload date:
  • Size: 8.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.3.tar.gz
Algorithm Hash digest
SHA256 1fa4694b1145d3091050f39cd6f358abb7f51ef70b3bd6ed5eddbdd4d0179eee
MD5 33171b6b7fbd5dc90dd579146fe94560
BLAKE2b-256 92583b1d47dd4a3d17afd27356cc8cbc2155c0659c418298d4f2c87b48bda162

See more details on using hashes here.

Provenance

The following attestation bundles were made for embeddedtorch-0.1.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: embeddedtorch-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.8 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 10a8b0b425acf35260a00afc0f36a5c18bb0de0f286adf4aee22b8d228a19613
MD5 de032c61502e56a21f0280d1c9aa648d
BLAKE2b-256 029c8ee72cee330dabdbf677ee8c922b1d3e0ca17751b6ec1cc6c61db953cb4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for embeddedtorch-0.1.3-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