mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-09 15:08:02 -05:00
fix tests
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user