mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-06 21:53:53 -05:00
failed test case when init jit with empty inputs (#13641)
not related to bert grad acc, but still seems to be a bug
This commit is contained in:
@@ -501,6 +501,18 @@ class TestJit(unittest.TestCase):
|
||||
b = f(Tensor([2.0]))
|
||||
assert abs((a - b).item()) > 0.5
|
||||
|
||||
def test_jit_init_with_empty_different_size(self):
|
||||
@TinyJit
|
||||
def f(x:Tensor) -> Tensor: return (x + 1).realize()
|
||||
|
||||
f(Tensor.empty(1))
|
||||
f(Tensor.empty(1))
|
||||
# TODO: this should fail since input has a different size
|
||||
f(Tensor(2.0)).item()
|
||||
# TODO: this should not fail, and should return 3
|
||||
with self.assertRaises(AssertionError):
|
||||
f(Tensor([2.0])).item()
|
||||
|
||||
@unittest.skip("Pending multioutput implementation #3607")
|
||||
class TestMultioutputJit(unittest.TestCase):
|
||||
def _test(self, f):
|
||||
|
||||
Reference in New Issue
Block a user