未验证 提交 776021c1 编写于 作者: 张春乔 提交者: GitHub

fix the NullPointerError of matrix_power (#50015)

上级 e03718f5
......@@ -317,6 +317,12 @@ class TestMatrixPowerAPIError(unittest.TestCase):
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):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册