tinygrad.utils -> extra.utils
MODIFY
examples/efficientnet.py
examples/efficientnet.py
@@ -10,7 +10,7 @@ import time
import numpy as np
np.set_printoptions(suppress=True)
from tinygrad.tensor import Tensor
-from tinygrad.utils import fetch, get_parameters
+from extra.utils import fetch, get_parameters
from extra.efficientnet import EfficientNet
def infer(model, img):

MODIFY
examples/serious_mnist.py
examples/serious_mnist.py
@@ -7,8 +7,8 @@ sys.path.append(os.path.join(os.getcwd(), 'test'))
from tinygrad.tensor import Tensor
from tinygrad.nn import BatchNorm2D
-from tinygrad.utils import get_parameters
import tinygrad.optim as optim
+from extra.utils import get_parameters
# TODO: abstract this generic trainer out of the test
from test_mnist import train as train_on_mnist

MODIFY
examples/train_efficientnet.py
examples/train_efficientnet.py
@@ -3,7 +3,7 @@ import time
import numpy as np
from extra.efficientnet import EfficientNet
from tinygrad.tensor import Tensor
-from tinygrad.utils import get_parameters, fetch
+from extra.utils import get_parameters, fetch
from tqdm import trange
import tinygrad.optim as optim
import io

MODIFY
extra/efficientnet.py
extra/efficientnet.py
import math
import numpy as np
from tinygrad.tensor import Tensor
-from tinygrad.utils import fetch
from tinygrad.nn import BatchNorm2D
+from extra.utils import fetch
USE_TORCH = False

MODIFY
test/test_mnist.py
test/test_mnist.py
@@ -3,8 +3,8 @@ import os
import unittest
import numpy as np
from tinygrad.tensor import Tensor, GPU
-from tinygrad.utils import fetch, get_parameters
import tinygrad.optim as optim
+from extra.utils import fetch, get_parameters
from tqdm import trange
# mnist loader

MODIFY
test/test_optim.py
test/test_optim.py
@@ -3,7 +3,7 @@ import torch
import unittest
from tinygrad.tensor import Tensor, GPU
from tinygrad.optim import Adam, SGD, RMSprop
-from tinygrad.utils import get_parameters
+from extra.utils import get_parameters
x_init = np.random.randn(1,3).astype(np.float32)
W_init = np.random.randn(3,3).astype(np.float32)

MODIFY
tinygrad/__init__.py
tinygrad/__init__.py
import tinygrad.optim
import tinygrad.tensor
-import tinygrad.utils
import tinygrad.nn

tinygrad.utils -> extra.utils