From 2fe98e44cdf7e4ba6b489f4fd35a3d5f16d1184d Mon Sep 17 00:00:00 2001 From: chenyu Date: Thu, 12 Dec 2024 13:05:02 -0500 Subject: [PATCH] unneeded isinstance(size, int) in alloc [pr] (#8189) --- tinygrad/device.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinygrad/device.py b/tinygrad/device.py index 3ce692492b..19771e2002 100644 --- a/tinygrad/device.py +++ b/tinygrad/device.py @@ -143,7 +143,7 @@ class Buffer: class Allocator: # overriden in LRUAllocator def alloc(self, size:int, options:Optional[BufferSpec]=None): - assert not isinstance(size, int) or size > 0, f"alloc size must be positve, getting {size}" + assert size > 0, f"alloc size must be positve, getting {size}" return self._alloc(size, options if options is not None else BufferSpec()) def free(self, opaque, size:int, options:Optional[BufferSpec]=None): self._free(opaque, options if options is not None else BufferSpec())