mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-10 07:28:15 -05:00
fix memory leaks, add gc test
This commit is contained in:
@@ -12,7 +12,7 @@ if __name__ == "__main__":
|
||||
img = np.zeros((BS,3,224,224), dtype=np.float32)
|
||||
|
||||
for i in range(32):
|
||||
print("running batch %d" % i)
|
||||
print("running batch %d, %d tensors allocated" % (i, Tensor.allocated))
|
||||
|
||||
st = time.time()
|
||||
out = model.forward(Tensor(img))
|
||||
@@ -31,3 +31,5 @@ if __name__ == "__main__":
|
||||
et = time.time()
|
||||
print("backward %.2f s" % (et-st))
|
||||
|
||||
del out, y, loss
|
||||
|
||||
|
||||
Reference in New Issue
Block a user