From 5db2f9a3fef74794cae9f8353fa4a35ecf6ed8f7 Mon Sep 17 00:00:00 2001 From: "Yan, Xiping" Date: Mon, 12 Jul 2021 11:13:06 +0800 Subject: [PATCH] revise atanh --- ngraph/core/include/ngraph/op/atanh.hpp | 4 ++-- ngraph/core/src/op/atanh.cpp | 2 +- ngraph/test/CMakeLists.txt | 2 ++ ngraph/test/type_prop/atanh.cpp | 9 +++++++++ ngraph/test/visitors/op/atanh.cpp | 12 ++++++++++++ 5 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 ngraph/test/type_prop/atanh.cpp create mode 100644 ngraph/test/visitors/op/atanh.cpp diff --git a/ngraph/core/include/ngraph/op/atanh.hpp b/ngraph/core/include/ngraph/op/atanh.hpp index 50cece8cfe4..5ba2e1c3997 100644 --- a/ngraph/core/include/ngraph/op/atanh.hpp +++ b/ngraph/core/include/ngraph/op/atanh.hpp @@ -19,8 +19,8 @@ namespace ngraph class NGRAPH_API Atanh : public util::UnaryElementwiseArithmetic { public: - static constexpr NodeTypeInfo type_info{"Atanh", 3}; - const NodeTypeInfo& get_type_info() const override { return type_info; } + NGRAPH_RTTI_DECLARATION; + /// \brief Constructs an Atanh operation. Atanh() = default; /// \brief Constructs an Atanh operation. diff --git a/ngraph/core/src/op/atanh.cpp b/ngraph/core/src/op/atanh.cpp index a14e6aaebe1..29dfba1181d 100644 --- a/ngraph/core/src/op/atanh.cpp +++ b/ngraph/core/src/op/atanh.cpp @@ -14,7 +14,7 @@ using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::v3::Atanh::type_info; +NGRAPH_RTTI_DEFINITION(op::Atanh, "Atanh", 0, util::UnaryElementwiseArithmetic); op::v3::Atanh::Atanh(const Output& arg) : UnaryElementwiseArithmetic(arg) diff --git a/ngraph/test/CMakeLists.txt b/ngraph/test/CMakeLists.txt index d6ed497fbf9..5f4085a527d 100644 --- a/ngraph/test/CMakeLists.txt +++ b/ngraph/test/CMakeLists.txt @@ -95,6 +95,7 @@ set(SRC type_prop/asinh.cpp type_prop/assign.cpp type_prop/atan.cpp + type_prop/atanh.cpp type_prop/avg_pool.cpp type_prop/batch_norm.cpp type_prop/batch_to_space.cpp @@ -232,6 +233,7 @@ set(SRC visitors/op/adaptive_max_pool.cpp visitors/op/asinh.cpp visitors/op/atan.cpp + visitors/op/atanh.cpp visitors/op/batch_norm.cpp visitors/op/batch_to_space.cpp visitors/op/broadcast.cpp diff --git a/ngraph/test/type_prop/atanh.cpp b/ngraph/test/type_prop/atanh.cpp new file mode 100644 index 00000000000..96d21a421a5 --- /dev/null +++ b/ngraph/test/type_prop/atanh.cpp @@ -0,0 +1,9 @@ +// Copyright (C) 2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "unary_ops.hpp" + +using Type = ::testing::Types; + +INSTANTIATE_TYPED_TEST_SUITE_P(type_prop_atanh, UnaryOperator, Type); diff --git a/ngraph/test/visitors/op/atanh.cpp b/ngraph/test/visitors/op/atanh.cpp new file mode 100644 index 00000000000..8e6ad8befc3 --- /dev/null +++ b/ngraph/test/visitors/op/atanh.cpp @@ -0,0 +1,12 @@ +// Copyright (C) 2021 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "unary_ops.hpp" + +using Types = ::testing::Types>; + +INSTANTIATE_TYPED_TEST_SUITE_P(visitor_without_attribute, + UnaryOperatorVisitor, + Types, + UnaryOperatorTypeName); \ No newline at end of file