kiruluta's picture
Upload folder using huggingface_hub
45eaa9d verified
Raw History Blame Contribute Delete
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())