talon-bridge - PyTorch Bridge for TALON IR
PyTorch helpers for the TALON IR (Tactical AI at Low-power On-device Nodes Intermediate Representation). This package enables PyTorch-based libraries to translate models to and from TALON IR, providing export, import, and execution capabilities for neuromorphic neural networks.
talon-bridge serves as the bridge between PyTorch models and TALON IR graphs, enabling seamless model portability and deployment to TALON hardware.
Read more about TALON IR in our documentation
Installation
uv add talon-bridge@git+ssh://git@github.com:type1compute/talonbridge.git
Or with pip:
pip install talon-bridge
Usage
talon-bridge provides two main functions to_ir and ir_to_torch that map PyTorch models to TALON IR graphs and vice versa.
Translating from PyTorch to TALON IR
talon-bridge automatically traces through your PyTorch model and converts each module to the corresponding TALON IR primitive. You can provide custom converters for unsupported modules via the custom_map argument.
import torch
import torch.nn as nn
from talon import bridge, ir
# Define your model
model = nn.Sequential(
nn.Linear(784, 128),
nn.Linear(128, 10)
)
# Export to TALON IR
graph = bridge.to_ir(model, torch.randn(1, 784))
# Save to file
ir.write("model.t1c", graph)
For custom modules, provide a mapping dictionary:
# Define custom PyTorch -> TALON IR mapping
from talon import bridge, ir
custom_map = {}
def _extract_custom_module(module: MyCustomModule) -> ir.Node:
# Convert your custom module to a TALON IR node
return ir.Affine(weight=module.weight, bias=module.bias, ...)
custom_map[MyCustomModule] = _extract_custom_module
# Export with custom mapping
graph = bridge.to_ir(model, sample, custom_map=custom_map)
Translating from TALON IR to PyTorch
talon-bridge automatically creates PyTorch modules from TALON IR nodes. The ir_to_torch function combines import with execution, returning an executable GraphExecutor module.
from talon import bridge
import torch
# Load and create executable module
executor = bridge.ir_to_torch("model.t1c")
# Execute
output = executor(input_tensor)
For stateful models (SNNs), use return_state=True:
# Load with state management
executor = bridge.ir_to_torch("model.t1c", return_state=True)
# Execute with state
state = None
for t in range(100):
output, state = executor(input_tensor, state)
You can also provide custom node converters:
from talon import bridge, ir
def custom_node_map(node: ir.Node) -> Optional[torch.nn.Module]:
if isinstance(node, MyCustomNode):
return MyCustomModule(...)
return None # Falls back to default converter
executor = bridge.ir_to_torch(graph, node_map=custom_node_map)
Quick Start
Basic Export and Execute
import torch
import torch.nn as nn
from talon import bridge, ir
# Your model
model = nn.Sequential(nn.Linear(784, 128), nn.Linear(128, 10))
sample = torch.randn(1, 784)
# Export to TALON IR
graph = bridge.to_ir(model, sample)
# Save to file
ir.write("model.t1c", graph)
# Load and execute
executor = bridge.ir_to_torch("model.t1c")
output = executor(sample)
Spiking Neural Network
import torch
import torch.nn as nn
import snntorch as snn
from talon import bridge
# Define SNN
model = nn.Sequential(
nn.Linear(784, 128),
snn.Leaky(beta=0.9, init_hidden=True, output=True),
nn.Linear(128, 10),
snn.Leaky(beta=0.9, init_hidden=True, output=True),
)
# Export
graph = bridge.to_ir(model, torch.randn(1, 784))
# Execute with state
executor = bridge.ir_to_torch(graph, return_state=True)
state = None
for t in range(100):
output, state = executor(input_tensor, state)
Supported Modules
talon-bridge automatically converts the following PyTorch modules to TALON IR:
| PyTorch Module | TALON IR Node | Notes |
|---|---|---|
nn.Linear |
Affine or SpikingAffine |
Use spiking=True for hardware-optimized version |
nn.Conv2d |
Conv2d |
Full 2D convolution support |
nn.Flatten |
Flatten |
Tensor flattening |
nn.MaxPool2d |
MaxPool2d |
2D max pooling |
nn.Identity |
Skip |
Skip/residual connections |
snn.Leaky |
LIF |
snnTorch LIF neuron |
For Hardware Teams
talon-bridge is for validation only. The execution runtime is a PyTorch simulation of what the hardware will do. Use it to verify your IR graph produces correct outputs before deploying to actual hardware.
The GraphExecutor handles:
- Topological sorting of graph nodes
- State management for stateful modules (LIF neurons)
- Skip connections and residual paths
- Multiple input/output handling
Development
From the repo root, install in editable mode (requires talon-ir installed first):
uv pip install -e .
# or: pip install -e .
pytest tests/ -v
If you see AttributeError: module 'talon.bridge' has no attribute 'to_ir', you are likely using an old install. Uninstall any legacy package and reinstall in editable mode:
pip uninstall talon-bridge 2>/dev/null; uv pip install -e .
Documentation
For more information, visit the TALON IR documentation.
Metadata
Release files for talon-bridge 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 37.5 MB
Release files / talon_bridge-0.0.2-cp313-cp313-win_amd64.whl
| Download URL | talon_bridge-0.0.2-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
adc84d0e869ed9c55af9eb864ab79ae250ca09785d95cc7731e3b0682ce55f66
|
|
BLAKE2b-256 checksum How to use checksums |
faac65d40c77158f810fff4b4930f68dbcfe99999f243cd8ff9048e75e2abeb4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.
Transparency logRelease files / talon_bridge-0.0.2-cp313-cp313-win32.whl
| Download URL | talon_bridge-0.0.2-cp313-cp313-win32.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.13 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
349cf405a09927258394ff9f9aec6f76ed62a458c0da0fe617af53c0e8b7acc5
|
|
BLAKE2b-256 checksum How to use checksums |
59bff2f4922d59f5dbcf6987b497451cbfa09107b5cad4c916caaa460ad08e26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.
Transparency logRelease files / talon_bridge-0.0.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | talon_bridge-0.0.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.8 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c5f772eca7863eb44fa1520f5a8145c50cb451086625b885426aad7b737308d1
|
|
BLAKE2b-256 checksum How to use checksums |
ba16660969eb8b5d7acd653e22c8215e907bc1288f48cdda9686d03321ee5836
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.
Transparency logRelease files / talon_bridge-0.0.2-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | talon_bridge-0.0.2-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a33008d65c10cbaf785c98bc133468b3b34bab1035b707b0742d1f541921a833
|
|
BLAKE2b-256 checksum How to use checksums |
7e88f7ef2d053a047a381576d6770bdea07f4de9787f58d007e7383f2a7d30a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.
Transparency logRelease files / talon_bridge-0.0.2-cp312-cp312-win_amd64.whl
| Download URL | talon_bridge-0.0.2-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
32cb5c69c6bd3be828e4589d080b7d1ebb86117e51f1d6b87a10f981ede29c32
|
|
BLAKE2b-256 checksum How to use checksums |
5a0bbc3128eb65e2f1e1a52c24fe56d7c75fe45d03254601c361a6955d54178f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.
Transparency logRelease files / talon_bridge-0.0.2-cp312-cp312-win32.whl
| Download URL | talon_bridge-0.0.2-cp312-cp312-win32.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.12 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
c3bfcf4f714e80a9de975c847f662170d7ff1338293c2c12f899cfaae48ff309
|
|
BLAKE2b-256 checksum How to use checksums |
ab7f94a7e9711bc5605e87fd8e80dbf7ff1e3941bb3aa9d6f4a05ad44e061e0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.
Transparency logRelease files / talon_bridge-0.0.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | talon_bridge-0.0.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.9 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
80344f0cd3472b6e453948348247acc90f1b1e4dd1b9c0b40033b5d5e2d82fd9
|
|
BLAKE2b-256 checksum How to use checksums |
a6bf30612b167e05c2db8ddf8df4eb3515f296209ae84e8e568cddd33c358da9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.
Transparency logRelease files / talon_bridge-0.0.2-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | talon_bridge-0.0.2-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
41c9e32a9cbf412f74171f7cd952a193d8d1a08ece699eead3e22206d7366fac
|
|
BLAKE2b-256 checksum How to use checksums |
076bb4888aceb9955fdde050c16122af3616a482c11be971f7db7ac109243b69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.
Transparency logRelease files / talon_bridge-0.0.2-cp311-cp311-win_amd64.whl
| Download URL | talon_bridge-0.0.2-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f542d6b37b361b4bb43e23b63e3f810755f259d57bb860fb009d116f9ffbf50a
|
|
BLAKE2b-256 checksum How to use checksums |
c585cea0038e256a3dd870ee197d881a03c643b0e992069fd1365ef3bb212d73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.
Transparency logRelease files / talon_bridge-0.0.2-cp311-cp311-win32.whl
| Download URL | talon_bridge-0.0.2-cp311-cp311-win32.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.11 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
6d50c4a32bc89581cc5c64893a6e4142e91497a2ce91e6a9e59760492111447c
|
|
BLAKE2b-256 checksum How to use checksums |
571910cfbeefff18080f534ce5e91e383e35d435de224ea09c962f600fd2daea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.
Transparency logRelease files / talon_bridge-0.0.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | talon_bridge-0.0.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.9 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
edbd94609b6cfc72eb175dd34b9b4477e5897d529e902720c1bb1afddc4093b1
|
|
BLAKE2b-256 checksum How to use checksums |
5cd7f52c2774f386dc29a0325f75946779a1585dfee3839662797591b05904cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.
Transparency logRelease files / talon_bridge-0.0.2-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | talon_bridge-0.0.2-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
dcfce3e5b670006d279fa9071281eca3fb334c1ceb2a5654ca0ec245c756a28b
|
|
BLAKE2b-256 checksum How to use checksums |
c63e0d47910482c0a9d7cf94876dd4983dc09aa07a1865a09c5f50caca8ca1cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.
Transparency logRelease files / talon_bridge-0.0.2-cp310-cp310-win_amd64.whl
| Download URL | talon_bridge-0.0.2-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
56eea4f4c650bb786c3568e6cba46a53d79dea619fe46fbc1fb7bda5879b3491
|
|
BLAKE2b-256 checksum How to use checksums |
638c5489dc59e41e85467c370f66cba78540d8edd73d4c087636cbdea6d700d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.
Transparency logRelease files / talon_bridge-0.0.2-cp310-cp310-win32.whl
| Download URL | talon_bridge-0.0.2-cp310-cp310-win32.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.10 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
fdf24819062872888c7528cb3870ff75b25f548e9e7eea6738e102b3af578999
|
|
BLAKE2b-256 checksum How to use checksums |
dfce044a108bb2b6f8061efb54c44a9535d6c54498c62f24f9cbddec0221b1c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.
Transparency logRelease files / talon_bridge-0.0.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | talon_bridge-0.0.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.7 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
23732ebdbeed2458494d2b38eb6ff936ba8b09b1a4a0d2afec43a827e6cbf219
|
|
BLAKE2b-256 checksum How to use checksums |
dbcef3b58f4c6ec268c04680d420db642b29a65bdd921d878e77ef1d67bb0b58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.
Transparency logRelease files / talon_bridge-0.0.2-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | talon_bridge-0.0.2-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
56f175305190a4e2a42d328e794ff654434ddcd64c6de430eecc65cfe883964a
|
|
BLAKE2b-256 checksum How to use checksums |
6f3c959921020783f4443aaa8edf2154c2ba9c7599cde0c2a6b6c7d072c7b95a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.
Transparency logSecurity for talon-bridge 0.0.2
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.
Full provenance
All 16 files in this release have been uploaded with provenance metadata.
Attestation for talon_bridge-0.0.2-cp313-cp313-win_amd64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.
Transparency logA 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.