Metadata-Version: 2.4
Name: tinysolve
Version: 0.2.0
Summary: torch.linalg.solve for tinygrad
Keywords: tinygrad,linear-algebra,linear-solver,solve,gpu,autograd
Author: FUJISHIGE TEMMA
Author-email: FUJISHIGE TEMMA <tenma.x0@gmail.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering
Classifier: Typing :: Typed
Requires-Dist: tinygrad>=0.13.0
Requires-Python: >=3.13
Project-URL: Homepage, https://github.com/FujishigeTemma/tinysolve
Project-URL: Repository, https://github.com/FujishigeTemma/tinysolve
Project-URL: Issues, https://github.com/FujishigeTemma/tinysolve/issues
Description-Content-Type: text/markdown

# tinysolve

`torch.linalg.solve` for [tinygrad](https://github.com/tinygrad/tinygrad): solve `A @ x = B` for `x`.

```python
from tinygrad import Tensor
from tinysolve import solve

A = Tensor.randn(2000, 16, 16) + 16 * Tensor.eye(16)
B = Tensor.randn(2000, 16, 4)

x = solve(A, B)  # (2000, 16, 4)

# differentiable (higher-order too)
gA, gB = solve(A, B).sum().gradient(A, B)
```

## Install

```sh
uv add tinysolve  # or: pip install tinysolve
```

## Development

```sh
uv run pytest                     # tests
uv run pytest tests/benchmark.py  # benchmarks
uv run ruff check . && uv run ty check
```

## License

MIT
