Metadata-Version: 2.1
Name: symtorch
Version: 0.2.0
Summary: Symbolic Expressions in PyTorch
Author-email: John Gardner <gardner.john97@gmail.com>
Project-URL: Homepage, https://github.com/jla-gardner/symtorch
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: torch
Requires-Dist: sympy
Requires-Dist: numpy
Provides-Extra: dev
Requires-Dist: bumpver; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: furo; extra == "docs"
Requires-Dist: nbsphinx; extra == "docs"
Requires-Dist: sphinxext-opengraph; extra == "docs"
Requires-Dist: sphinx-copybutton; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
Requires-Dist: sphinx-design; extra == "docs"
Requires-Dist: sphinx-codeautolink; extra == "docs"
Provides-Extra: publish
Requires-Dist: build; extra == "publish"
Requires-Dist: twine; extra == "publish"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"

<div align="center">
<img src="https://raw.githubusercontent.com/jla-gardner/symtorch/main/docs/source/_static/icon-with-text.svg" style="width: min(100%, 400px); height: auto;"/>
</div>

---

Fast, optimisable, symbolic expressions in PyTorch.

```python-repl
>>> from symtorch import symtorchify
>>> f = symtorchify("x**2 + 2.5*x + 1.7")
>>> f
x²+2.5x+1.7
>>> f({"x": torch.tensor(2.0)})
tensor([10.7000], grad_fn=<AddBackward0>)
```

## Installation

```bash
pip install symtorch
```

## Features

- Symbolic expressions with PyTorch integration
- Automatic differentiation and optimization
- Compatible with TorchScript
- Easy saving and loading via PyTorch's native mechanisms
- Seamless integration with existing PyTorch models

For detailed documentation and examples, visit our [Documentation](https://jla-gardner.github.io/symtorch/).
