From 8bba3a063add538256c341df64f853bd41416fe1 Mon Sep 17 00:00:00 2001 From: z00512249 Date: Thu, 24 Feb 2022 19:52:19 +0800 Subject: [PATCH] fix scipy st utils to creat_sys_pos_martix --- tests/st/scipy_st/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/st/scipy_st/utils.py b/tests/st/scipy_st/utils.py index 71166aca23d..73e2f935cc5 100644 --- a/tests/st/scipy_st/utils.py +++ b/tests/st/scipy_st/utils.py @@ -94,8 +94,8 @@ def create_sym_pos_matrix(shape, dtype): 'Symmetric positive definite matrix must be a square matrix, but has shape: ', shape) n = shape[-1] - a = (onp.random.random(shape) + onp.eye(n)).astype(dtype) - return onp.dot(a, a.T) + x = onp.random.random(shape) + return (onp.matmul(x, x.T) + onp.eye(n)).astype(dtype) def gradient_check(x, net, epsilon=1e-3, enumerate_fn=onp.ndenumerate):