add failed Tensor.pow test cases (#3334)

tried refactoring pow and found some bugs
This commit is contained in:
chenyu
2024-02-07 04:28:24 -05:00
committed by GitHub
parent ea74856d99
commit ca66be6a70

View File

@@ -383,6 +383,10 @@ 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, should be nan
helper_test_op(None, lambda x: (-2)**x, vals=[[-2.,-1,0,1,2,3]], forward_only=True)
def test_sqrt(self):
helper_test_op([(45,65)], lambda x: x.sqrt())