From 201d9a2d5836ffd62645f16c60e5c19e666d6178 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Wed, 1 Mar 2023 21:19:44 -0800 Subject: [PATCH] remove extra copy on output --- tinygrad/tensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinygrad/tensor.py b/tinygrad/tensor.py index b088134118..0e06944f75 100644 --- a/tinygrad/tensor.py +++ b/tinygrad/tensor.py @@ -87,7 +87,7 @@ class Tensor: return self def detach(self): return Tensor(self.lazydata, device=self.device, requires_grad=False) - def numpy(self) -> np.ndarray: return np.array(self.lazydata.toCPU()) + def numpy(self) -> np.ndarray: return self.lazydata.toCPU() # TODO: if things are realized this won't work def to_(self, device:str):