diff --git a/test/test_net_speed.py b/test/test_net_speed.py index 754150a4a7..8093246032 100644 --- a/test/test_net_speed.py +++ b/test/test_net_speed.py @@ -77,7 +77,7 @@ class TestConvSpeed(unittest.TestCase): x = Tensor.randn(128, 1, 28, 28) x = x.conv2d(c1).relu().avg_pool2d() x = x.conv2d(c2).relu().max_pool2d() - x = x.reshape(Tensor(np.array((x.shape[0], -1)))) + x = x.reshape(shape=(x.shape[0], -1)) out = x.dot(l1).logsoftmax() out = out.mean() et1 = time.time() diff --git a/tinygrad/tensor.py b/tinygrad/tensor.py index a45eecfd71..cca9369466 100644 --- a/tinygrad/tensor.py +++ b/tinygrad/tensor.py @@ -13,9 +13,11 @@ class Tensor: elif type(data) != np.ndarray: print("error constructing tensor with %r" % data) assert(False) + if data.dtype != np.float32: + # warning? float64 is actually needed for numerical jacobian + pass - # only float32 - self.data = data.astype(np.float32) + self.data = data self.grad = None # internal variables used for autograd graph construction