diff --git a/test/test_dtype.py b/test/test_dtype.py index d5e253ad8a..471a9a669f 100644 --- a/test/test_dtype.py +++ b/test/test_dtype.py @@ -120,7 +120,9 @@ class TestDType(unittest.TestCase): data = [1., 2., 0., 0.5, -1.5, 5.25] for dt in dtypes: arr = np.asarray(data).astype(dt) - tin = Tensor(arr).numpy() + tensor = Tensor(arr) + if not is_dtype_supported(tensor.dtype): continue + tin = tensor.numpy() tor = torch.as_tensor(arr).detach().numpy() assert dt == tin.dtype == tor.dtype, f"dtype mismatch: expected={dt} | tinygrad={tin.dtype} | torch={tor.dtype}" np.testing.assert_allclose(tin, tor, atol=1e-6, rtol=1e-3) diff --git a/test/test_tiny.py b/test/test_tiny.py index cd276f4141..04544d825f 100644 --- a/test/test_tiny.py +++ b/test/test_tiny.py @@ -46,8 +46,9 @@ class TestTiny(unittest.TestCase): nonlocal cnt cnt += 1 return a+b - fa,fb = Tensor([1.,2,3]), Tensor([4.,5,6]) - for _ in range(3): fxn(fa, fb) + for _ in range(3): + fa,fb = Tensor([1.,2,3]), Tensor([4.,5,6]) + fxn(fa, fb) # function is only called twice self.assertEqual(cnt, 2)