Skip to content

Commit

Permalink
fix the NullPointerError of matrix_power (#50015)
Browse files Browse the repository at this point in the history
  • Loading branch information
Liyulingyue authored Feb 1, 2023
1 parent e03718f commit 776021c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/paddle/fluid/tests/unittests/test_matrix_power_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,12 @@ def test_errors(self):
input = fluid.data(name="input_4", shape=[1, 1, 0, 0], dtype="float32")
self.assertRaises(ValueError, paddle.linalg.matrix_power, input, 2)

# The size of input should not be 0
input = fluid.data(name="input_5", shape=[0, 0], dtype="float32")
self.assertRaises(
ValueError, paddle.linalg.matrix_power, input, -956301312
)


class TestMatrixPowerSingularAPI(unittest.TestCase):
def setUp(self):
Expand Down

0 comments on commit 776021c

Please sign in to comment.