torch.linalg.solve for tinygrad
Project description
tinysolve
torch.linalg.solve for tinygrad: solve A @ x = B for x.
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
uv add tinysolve # or: pip install tinysolve
Development
uv run pytest # tests
uv run pytest tests/benchmark.py # benchmarks
uv run ruff check . && uv run ty check
License
MIT
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
tinysolve-0.2.0.tar.gz
(5.8 kB
view details)
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 tinysolve-0.2.0.tar.gz.
File metadata
- Download URL: tinysolve-0.2.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cbec12d0846ba5991019aecfc7679a764705e2ad03cd4e909a06ef9c408587a
|
|
| MD5 |
68fc74cb015eff3f50c193bd74e0a245
|
|
| BLAKE2b-256 |
92c79383d62e28425c6a4464107f3a1655398f4785f97e4af85ea6b6d6be1ebd
|
File details
Details for the file tinysolve-0.2.0-py3-none-any.whl.
File metadata
- Download URL: tinysolve-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6497270f006214c39c9b70e9cb4934dff157ea9d240bf2b88ceef279186b491
|
|
| MD5 |
f4b7ed1cef0c81c0fe815224358b74c0
|
|
| BLAKE2b-256 |
9aca93cb1aa343236c4bf0c5c376701cf8889435fc5f2cde0afeb99746a70ad9
|