forked from tinygrad/tinygrad
update test_setitem_overlapping_inplace1 (#7494)
failed on LLVM and remu, not real AMD
This commit is contained in:
+13
-4
@@ -1,5 +1,6 @@
|
||||
import unittest
|
||||
from tinygrad import Device, Tensor, TinyJit, Variable, dtypes
|
||||
from tinygrad.helpers import CI
|
||||
import numpy as np
|
||||
|
||||
class TestSetitem(unittest.TestCase):
|
||||
@@ -114,12 +115,20 @@ class TestSetitem(unittest.TestCase):
|
||||
np.testing.assert_allclose(t.numpy(), n)
|
||||
np.testing.assert_allclose(t.numpy(), [[1,1,1,1,1,1],[2,2,2,2,2,2],[3,3,3,3,3,3],[4,4,4,4,4,4],[5,5,5,5,5,5],[6,6,6,6,6,6]])
|
||||
|
||||
@unittest.skipUnless(Device.DEFAULT in {"LLVM", "AMD"}, "only fails on LLVM and AMD")
|
||||
@unittest.expectedFailure
|
||||
def test_setitem_overlapping_inplace(self):
|
||||
def test_setitem_overlapping_inplace1(self):
|
||||
t = Tensor([[3.0], [2.0], [1.0]]).contiguous()
|
||||
t[1:] = t[:-1]
|
||||
self.assertEqual(t.tolist(), [[3.0], [3.0], [2.0]])
|
||||
if (Device.DEFAULT == "LLVM") or (CI and Device.DEFAULT == "AMD"):
|
||||
# TODO: FIXME
|
||||
with self.assertRaises(AssertionError):
|
||||
self.assertEqual(t.tolist(), [[3.0], [3.0], [2.0]])
|
||||
else:
|
||||
self.assertEqual(t.tolist(), [[3.0], [3.0], [2.0]])
|
||||
|
||||
def test_setitem_overlapping_inplace2(self):
|
||||
t = Tensor([[3.0], [2.0], [1.0]]).contiguous()
|
||||
t[:-1] = t[1:]
|
||||
self.assertEqual(t.tolist(), [[2.0], [1.0], [1.0]])
|
||||
|
||||
class TestWithGrad(unittest.TestCase):
|
||||
def test_no_requires_grad_works(self):
|
||||
|
||||
Reference in New Issue
Block a user