Skip to content

Commit

Permalink
fix the NullPointerError of matrix_power (PaddlePaddle#50015)
Browse files Browse the repository at this point in the history
  • Loading branch information
Liyulingyue authored and pangengzheng committed Feb 2, 2023
1 parent 6841357 commit 292ff27
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 292ff27

Please sign in to comment.