fix cholesky of test_math_op_patch_var_base (#27591)

revert-27356-init_low_level_gloo
Zhou Wei 4 years ago committed by GitHub
parent 9b7ebf1099
commit c5b6e44b4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -341,10 +341,12 @@ class TestMathOpPatchesVarBase(unittest.TestCase):
np.array_equal(x.rank().numpy(), paddle.rank(x).numpy())) np.array_equal(x.rank().numpy(), paddle.rank(x).numpy()))
self.assertTrue( self.assertTrue(
np.array_equal(x[0].t().numpy(), paddle.t(x[0]).numpy())) np.array_equal(x[0].t().numpy(), paddle.t(x[0]).numpy()))
m = paddle.to_tensor(np.random.uniform(1, 2, [3, 3]), 'float32') d = paddle.to_tensor([[1.2285208, 1.3491015, 1.4899898],
m = m.matmul(m.t()) [1.30058, 1.0688717, 1.4928783],
[1.0958099, 1.3724753, 1.8926544]])
d = d.matmul(d.t())
self.assertTrue( self.assertTrue(
np.array_equal(m.cholesky().numpy(), paddle.cholesky(m).numpy())) np.array_equal(d.cholesky().numpy(), paddle.cholesky(d).numpy()))
self.assertTrue( self.assertTrue(
np.array_equal(x.is_empty().numpy(), paddle.is_empty(x).numpy())) np.array_equal(x.is_empty().numpy(), paddle.is_empty(x).numpy()))

Loading…
Cancel
Save