Skip to content

Commit

Permalink
failed test cases for Tensor.round (tinygrad#3240)
Browse files Browse the repository at this point in the history
it should round to even
  • Loading branch information
chenyuxyz authored Jan 25, 2024
1 parent b0b5eba commit da5e279
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@ def test_ceil(self):
def test_round(self):
helper_test_op([(45,35)], lambda x: x.round(), forward_only=True)
helper_test_op(None, lambda x: x.round(), vals=[[1.499, 1.5, 1.501, 1.0, 2.1, 0.0, -5.0, -2.499, -2.5, -2.501]], forward_only=True)
# TODO: implement round to even
with self.assertRaises(Exception):
helper_test_op(None, lambda x: x.round(), vals=[[2.5]], forward_only=True)
with self.assertRaises(Exception):
helper_test_op(None, lambda x: x.round(), vals=[[-1.5]], forward_only=True)

def test_tril(self):
helper_test_op([(3,3)], lambda x: x.tril())
helper_test_op([(3,3)], lambda x: x.tril(1))
Expand Down

0 comments on commit da5e279

Please sign in to comment.