From 3cf5764692fcd1ca6499930f50601611f56463a1 Mon Sep 17 00:00:00 2001 From: levi131 <83750468+levi131@users.noreply.github.com> Date: Thu, 14 Oct 2021 16:45:27 +0800 Subject: [PATCH] enable 3rd order test case (#36427) --- .../paddle/fluid/tests/unittests/autograd/test_hessian.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/autograd/test_hessian.py b/python/paddle/fluid/tests/unittests/autograd/test_hessian.py index 120a6c853e8..1aa0d94de16 100644 --- a/python/paddle/fluid/tests/unittests/autograd/test_hessian.py +++ b/python/paddle/fluid/tests/unittests/autograd/test_hessian.py @@ -16,6 +16,7 @@ import unittest import numpy as np import paddle import paddle.compat as cpt +import paddle.nn.functional as F from utils import _compute_numerical_hessian @@ -107,10 +108,9 @@ class TestHessian(unittest.TestCase): error_msg = cpt.get_exception_message(e) assert error_msg.find("has no gradient") > 0 - # TODO(levi): enable this test case when matmul_grad_grad_grad is ok - def _test_create_graph_true(self): + def test_create_graph_true(self): def func(x): - return paddle.sum(paddle.matmul(x, x)) + return paddle.sum(F.sigmoid(x)) numerical_hessian = _compute_numerical_hessian( func, self.x, self.numerical_delta, self.np_dtype) -- GitLab