improve conv testing
MODIFY
test/test_mnist.py
test/test_mnist.py
@@ -74,7 +74,6 @@ def evaluate(model):
assert accuracy > 0.95
class TestMNIST(unittest.TestCase):
- @unittest.skip(reason="mad slow")
def test_conv(self):
np.random.seed(1337)
model = TinyConvNet()

MODIFY
test/test_tensor.py
test/test_tensor.py
@@ -66,8 +66,11 @@ class TestTinygrad(unittest.TestCase):
class TestOps(unittest.TestCase):
def test_conv2d(self):
- x = torch.randn((5,2,10,7), requires_grad=True)
- w = torch.randn((4,2,3,2), requires_grad=True)
+ for cin in [1,2,3]:
+ for H in [2,3,5]:
+ for W in [2,3,5]:
+ x = torch.randn((5,cin,10,7), requires_grad=True)
+ w = torch.randn((4,cin,H,W), requires_grad=True)
xt = Tensor(x.detach().numpy())
wt = Tensor(w.detach().numpy())

improve conv testing