perf: no ret needed (#1604)

Co-authored-by: Roelof van Dijk <roelof.van.dijk@vitestro.com>
This commit is contained in:
Roelof van Dijk
2023-08-21 23:05:13 +02:00
committed by GitHub
parent 750714c386
commit 2c8f8ac611

View File

@@ -188,8 +188,7 @@ class LazyBuffer:
def toCPU(self):
assert self.dtype.np, f"{self.dtype} is not supported in toCPU"
realized = self.cast((dtypes.from_np(self.dtype.np), False)).contiguous().realize().realized
ret = cast(RawBuffer, realized).toCPU().reshape(self.shape)
return ret
return cast(RawBuffer, realized).toCPU().reshape(self.shape)
def cast(self:LazyBuffer, arg:Tuple[DType, bool]) -> LazyBuffer:
assert not arg[1] or self.dtype.itemsize == arg[0].itemsize, "can't bitcast mismatched dtype itemsizes"