Download tests/test_scalable.py from kiruluta/Hilbert-Operator-Intelligence: direct link, hf CLI and curl.
- Browser
- Download file 312 Bytes
-
https://huggingface.co/kiruluta/Hilbert-Operator-Intelligence/resolve/main/tests/test_scalable.py
- Command line
-
hf download hf://kiruluta/Hilbert-Operator-Intelligence/tests/test_scalable.py
-
curl -L -o test_scalable.py https://huggingface.co/kiruluta/Hilbert-Operator-Intelligence/resolve/main/tests/test_scalable.py
312 Bytes
| import torch | |
| from hilbert_mi.scalable import HilbertOperatorClassifier | |
| def test_forward_and_backward(): | |
| m=HilbertOperatorClassifier(width=8,depth=1,modes=4,rank=2) | |
| x=torch.randn(2,3,16,16); y=m(x) | |
| assert y.shape==(2,10); y.sum().backward() | |
| assert all(p.grad is not None for p in m.parameters()) | |