Metadata-Version: 2.4
Name: nengo-torch
Version: 0.1.0
Summary: PyTorch backend experiment for Nengo Signal/Operator simulations.
License-Expression: MIT
Keywords: nengo,pytorch,torch,neural-simulation,spiking-neural-networks
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: nengo
Requires-Dist: numpy
Requires-Dist: torch
Provides-Extra: examples
Requires-Dist: scikit-learn; extra == "examples"
Provides-Extra: colab
Requires-Dist: scikit-learn; extra == "colab"
Provides-Extra: triton
Requires-Dist: triton; platform_system == "Linux" and extra == "triton"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: nengo; extra == "test"
Requires-Dist: tomli; python_version < "3.11" and extra == "test"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: scikit-learn; extra == "dev"
Requires-Dist: tomli; python_version < "3.11" and extra == "dev"
Dynamic: license-file

# 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:

```bash
python -m pip install nengo-torch
```

From a source checkout:

```bash
python -m pip install .
```

For editable development:

```bash
python -m pip install -e .
```

For examples that load real datasets:

```bash
python -m pip install ".[examples]"
```

For Linux CUDA environments where Triton kernels should be available:

```bash
python -m pip install ".[triton]"
```

## Verify The Install

Run the installed smoke test:

```bash
nengotorch-smoke --device auto
```

Verify the fallback-free fast/core path:

```bash
nengotorch-smoke --device auto --mode fast --require-compile-safe
```

Or through Python:

```bash
python -m nengo_torch --device auto --json
```

On GPU/Triton machines:

```bash
nengotorch-smoke --device cuda --require-triton
```

## Minimal Use

```python
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`.
