From c74764bac32f2e89ccf225adb71f9d6720834367 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Sun, 25 Oct 2020 08:28:18 -0700 Subject: [PATCH] oops, set to None --- README.md | 5 ----- test/test_conv_speed.py | 2 +- tinygrad/utils.py | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0e998f12..5d54e7e8 100644 --- a/README.md +++ b/README.md @@ -67,8 +67,3 @@ loss.backward() optim.step() ``` -### TODO (to make real neural network library) - -* Implement gradcheck (numeric) -* Make convolutions not slow while removing lines of code (NO CYTHON!) - diff --git a/test/test_conv_speed.py b/test/test_conv_speed.py index 5f116995..a68f6f5d 100644 --- a/test/test_conv_speed.py +++ b/test/test_conv_speed.py @@ -6,7 +6,7 @@ try: builtins.__dict__['profile'] = prof # add @profile decorator to probe except ImportError: - pass + prof = None import cProfile import unittest diff --git a/tinygrad/utils.py b/tinygrad/utils.py index 57c65fc0..833b1d1f 100644 --- a/tinygrad/utils.py +++ b/tinygrad/utils.py @@ -34,11 +34,11 @@ def fetch_mnist(): def im2col(x, H, W): bs,cin,oy,ox = x.shape[0], x.shape[1], x.shape[2]-(H-1), x.shape[3]-(W-1) + # TODO: use something like np.take for speed tx = np.empty((bs, oy, ox, cin*W*H), dtype=x.dtype) for Y in range(oy): for X in range(ox): tx[:, Y, X] = x[:, :, Y:Y+H, X:X+W].reshape(bs, -1) - return tx.reshape(-1, cin*W*H) def col2im(tx, H, W, OY, OX):