PyTorch backend experiment for Nengo Signal/Operator simulations.
Project description
NengoTorch
NengoTorch lets users keep normal Nengo model construction and run the backend
through PyTorch tensors. Build models with nengo.Network, nengo.Node,
nengo.Ensemble, nengo.Connection, and nengo.Probe, then use
nengo_torch.Simulator.
Install
When published to PyPI:
python -m pip install nengo-torch
From a source checkout:
python -m pip install .
For editable development:
python -m pip install -e .
For examples that load real datasets:
python -m pip install ".[examples]"
For Linux CUDA environments where Triton kernels should be available:
python -m pip install ".[triton]"
Verify The Install
Run the installed smoke test:
nengotorch-smoke --device auto
Verify the fallback-free fast/core path:
nengotorch-smoke --device auto --mode fast --require-compile-safe
Or through Python:
python -m nengo_torch --device auto --json
On GPU/Triton machines:
nengotorch-smoke --device cuda --require-triton
Minimal Use
import nengo
import torch
import nengo_torch
with nengo.Network(seed=1) as net:
inp = nengo_torch.InputNode(size_out=1)
out = nengo.Node(size_in=1)
nengo.Connection(inp, out, synapse=None)
probe = nengo.Probe(out)
x = torch.tensor([[[1.0], [2.0], [3.0]]])
with nengo_torch.Simulator(net, minibatch_size=1, progress_bar=False) as sim:
y = sim.forward({inp: x}, n_steps=x.shape[1])[probe]
print(y.shape)
For Colab-specific setup details, see docs/colab.md.
For broader install scenarios, see docs/install.md.
License
MIT. See LICENSE.
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 nengo_torch-0.1.0.tar.gz.
File metadata
- Download URL: nengo_torch-0.1.0.tar.gz
- Upload date:
- Size: 59.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18019d12f0d9e38a197d3f321ced02f4a19497bc158e8ff20b7fb4b0993f1539
|
|
| MD5 |
ae1abb547edee1f3d7cee8b7f7110f05
|
|
| BLAKE2b-256 |
29fccdcbd4d126eea4dbbd892a2f960aafee2311bc3bc4bd96e920498a5d12bc
|
File details
Details for the file nengo_torch-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nengo_torch-0.1.0-py3-none-any.whl
- Upload date:
- Size: 67.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee058960737c106a71698516c7b45f06bc4b6783d3716edb7b7081fcc05bf507
|
|
| MD5 |
f9121125ec3d92352a8518757f550f71
|
|
| BLAKE2b-256 |
cadc085fab4fa722189c8580987484506eb4b47b1fc82e8b57e157453b0995e2
|