mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-06-24 02:14:17 +00:00
Skip test that requires lru if device's allocator isn't lru (#10003)
This commit is contained in:
parent
954cb06957
commit
0730ff0e50
1 changed files with 2 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue