pow cleanup part 2 (#4727)

more cleanups and fix 0 ** 0
This commit is contained in:
chenyu
2024-05-25 07:17:40 -04:00
committed by GitHub
parent 85e57223bd
commit 7e90026eb0
2 changed files with 12 additions and 10 deletions

View File

@@ -419,8 +419,8 @@ class TestOps(unittest.TestCase):
helper_test_op([(45,65)], lambda x: 2.0**x)
helper_test_op([()], lambda x: x**2.0)
helper_test_op([()], lambda x: 2.0**x)
# TODO: fix 0**x and 0**0 == 1
# helper_test_op(None, lambda x: 0**x, vals=[[-2.,-1,0,1,2,3]])
# TODO: fix backward
helper_test_op(None, lambda x: 0**x, vals=[[-2.,-1,0,1,2,3]], forward_only=True)
# TODO: fix backward, should be nan
helper_test_op(None, lambda x: (-2)**x, vals=[[-2.,-1,0,1,2,3]], forward_only=True)