提交 842b8588 authored 作者: Matt Graham's avatar Matt Graham

Making sure test matrices are well-conditioned and correct dtype.

上级 9e03a2e2
......@@ -229,7 +229,10 @@ class test_Solve(utt.InferShapeTester):
upper_solve_func(U_val, b_val))
def verify_solve_grad(self, m, n, A_structure, lower, rng):
A_val = rng.normal(size=(m, m))
# ensure diagonal elements of A relatively large to avoid numerical
# precision issues
A_val = (rng.normal(size=(m, m)) * 0.5 +
numpy.eye(m)).astype(config.floatX)
if A_structure == 'lower_triangular':
A_val = numpy.tril(A_val)
elif A_structure == 'upper_triangular':
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论