From 0730ff0e5015b341c93def87d4af7fca026b5666 Mon Sep 17 00:00:00 2001 From: uuuvn <83587632+uuuvn@users.noreply.github.com> Date: Wed, 23 Apr 2025 20:12:56 +0500 Subject: [PATCH] Skip test that requires lru if device's allocator isn't lru (#10003) --- test/test_image_dtype.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test_image_dtype.py b/test/test_image_dtype.py index c9d8d33676..568a17fcf8 100644 --- a/test/test_image_dtype.py +++ b/test/test_image_dtype.py @@ -1,7 +1,7 @@ import unittest import numpy as np from tinygrad import Device, dtypes, Tensor, Context -from tinygrad.device import is_dtype_supported +from tinygrad.device import LRUAllocator, is_dtype_supported from tinygrad.dtype import ImageDType from tinygrad.engine.realize import lower_schedule from tinygrad.helpers import prod, unwrap @@ -91,6 +91,7 @@ class TestImageDType(unittest.TestCase): imgv = it.numpy() np.testing.assert_equal(np.maximum(imgv[:, 0], 0), it[:, 0].relu().numpy()) + @unittest.skipUnless(isinstance(Device.default.allocator, LRUAllocator), "Requires LRU") def test_lru_alloc(self): data = Tensor.randn(9*27*4).realize() it = data.cast(dtypes.imagef((9,27,4))).realize()