huh, torch 1.12 broke it. remove unused requirements.txt and pin torch 1.11

This commit is contained in:
George Hotz 2022-07-02 23:07:59 -07:00
parent e822aae9ec
commit 0d82cfd587
3 changed files with 5 additions and 18 deletions

View File

@ -1,14 +0,0 @@
numpy
pyopencl==2020.2.2
pillow
# util deps
requests
# testing deps
--find-links https://download.pytorch.org/whl/torch_stable.html
torch==1.6.0+cpu
torchvision==0.7.0+cpu
pytest
tqdm
protobuf~=3.19.0
onnx
onnx2torch

View File

@ -25,7 +25,7 @@ setup(name='tinygrad',
'gpu': ["pyopencl", "six"],
'testing': [
"pytest",
"torch",
"torch~=1.11.0",
"tqdm",
"protobuf~=3.19.0",
"onnx",

View File

@ -10,14 +10,15 @@ class TorchBuffer(torch.Tensor):
return super().__new__(cls, shape)
else:
return TorchBuffer(torch.zeros(shape)).to(device)
custompad = lambda x,padding: torch.nn.functional.pad(x, [item for sublist in padding[::-1] for item in sublist])
def custompad(x, padding): return torch.nn.functional.pad(x, [item for sublist in padding[::-1] for item in sublist])
def getdtype(self): return np.float32
@staticmethod
def fromCPU(data):
return TorchBuffer(torch.from_numpy(data).requires_grad_(False)).to(device)
def toCPU(x):
return x.cpu().numpy()
def getdtype(self):
return np.float32
unary_op, binary_op, reduce_op, movement_op = CPUBuffer.unary_op, CPUBuffer.binary_op, CPUBuffer.reduce_op, CPUBuffer.movement_op