From f34830e2aa179f98cee37cd48016e9b32e512ab2 Mon Sep 17 00:00:00 2001 From: Krzysztof Binias Date: Mon, 27 May 2019 16:47:25 +0200 Subject: [PATCH] Enable SQRT operator for the nGraph Bridge (#17549) * Enable sqrt operator for the nGraph Bridge. test=develop * Update activation_op.h --- paddle/fluid/operators/ngraph/ops/activation_op.h | 1 + .../fluid/tests/unittests/ngraph/test_activation_ngraph_op.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/operators/ngraph/ops/activation_op.h b/paddle/fluid/operators/ngraph/ops/activation_op.h index 884ec659267..4e654293c59 100644 --- a/paddle/fluid/operators/ngraph/ops/activation_op.h +++ b/paddle/fluid/operators/ngraph/ops/activation_op.h @@ -113,5 +113,6 @@ void BuildTanhGradNode( REGISTER_NG_OP(gelu, BuildGeluNode); REGISTER_NG_OP(gelu_grad, BuildGeluGradNode); REGISTER_NG_OP(relu_grad, BuildReluGradNode); +REGISTER_NG_OP(sqrt, BuildUnaryNode); REGISTER_NG_OP(square, BuildSquareNode); REGISTER_NG_OP(tanh_grad, BuildTanhGradNode); diff --git a/python/paddle/fluid/tests/unittests/ngraph/test_activation_ngraph_op.py b/python/paddle/fluid/tests/unittests/ngraph/test_activation_ngraph_op.py index a7f167cbd41..1a8a41f3c82 100644 --- a/python/paddle/fluid/tests/unittests/ngraph/test_activation_ngraph_op.py +++ b/python/paddle/fluid/tests/unittests/ngraph/test_activation_ngraph_op.py @@ -18,7 +18,7 @@ import unittest import numpy as np import paddle.fluid.core as core from paddle.fluid.tests.unittests.op_test import OpTest -from paddle.fluid.tests.unittests.test_activation_op import TestAbs, TestGelu, TestSigmoid, TestSquare, TestRelu, TestTanh +from paddle.fluid.tests.unittests.test_activation_op import TestAbs, TestGelu, TestSigmoid, TestSqrt, TestSquare, TestRelu, TestTanh class TestNGRAPHReluDim4(TestRelu): -- GitLab