mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-06-14 00:45:16 +08:00
Skip test that requires lru if device's allocator isn't lru (#10003)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user