diff --git a/ngraph/src/ngraph/frontend/onnx_import/CMakeLists.txt b/ngraph/src/ngraph/frontend/onnx_import/CMakeLists.txt index bdf4142ec5e..1400d1ec51d 100644 --- a/ngraph/src/ngraph/frontend/onnx_import/CMakeLists.txt +++ b/ngraph/src/ngraph/frontend/onnx_import/CMakeLists.txt @@ -42,7 +42,6 @@ add_library(onnx_importer SHARED exceptions.cpp exceptions.hpp op/acos.hpp - op/acosh.cpp op/acosh.hpp op/add.hpp op/add.cpp diff --git a/ngraph/src/ngraph/frontend/onnx_import/default_opset.hpp b/ngraph/src/ngraph/frontend/onnx_import/default_opset.hpp index 7ecd525487b..33003443db4 100644 --- a/ngraph/src/ngraph/frontend/onnx_import/default_opset.hpp +++ b/ngraph/src/ngraph/frontend/onnx_import/default_opset.hpp @@ -1,9 +1,9 @@ -#include "ngraph/opsets/opset3.hpp" +#include "ngraph/opsets/opset4.hpp" namespace ngraph { namespace onnx_import { - namespace default_opset = ngraph::opset3; + namespace default_opset = ngraph::opset4; } } diff --git a/ngraph/src/ngraph/frontend/onnx_import/op/acosh.cpp b/ngraph/src/ngraph/frontend/onnx_import/op/acosh.cpp deleted file mode 100644 index d69ebb7b8b1..00000000000 --- a/ngraph/src/ngraph/frontend/onnx_import/op/acosh.cpp +++ /dev/null @@ -1,60 +0,0 @@ -//***************************************************************************** -// Copyright 2017-2020 Intel Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//***************************************************************************** - -#include - -#include "acosh.hpp" -#include "default_opset.hpp" -#include "ngraph/op/add.hpp" -#include "ngraph/op/multiply.hpp" -#include "ngraph/op/subtract.hpp" -#include "ngraph/shape.hpp" - -namespace ngraph -{ - namespace onnx_import - { - namespace op - { - namespace set_1 - { - NodeVector acosh(const Node& node) - { - std::shared_ptr data{node.get_ng_inputs().at(0)}; - - // Define inverse hyperbolic cosine in terms of natural logarithm: - // - // arccosh(x) = ln(x + sqrt(x^2 - 1)) - // - - const auto one = - default_opset::Constant::create(data->get_element_type(), {}, {1.f}); - - const auto x_square = std::make_shared(data, data); - const auto sqrt_args = std::make_shared(x_square, one); - const auto sqrt_node = std::make_shared(sqrt_args); - const auto log_args = std::make_shared(data, sqrt_node); - - return {std::make_shared(log_args)}; - } - - } // namespace set_1 - - } // namespace op - - } // namespace onnx_import - -} // namespace ngraph diff --git a/ngraph/src/ngraph/frontend/onnx_import/op/acosh.hpp b/ngraph/src/ngraph/frontend/onnx_import/op/acosh.hpp index 4a20e8e285d..77f1e1a87e5 100644 --- a/ngraph/src/ngraph/frontend/onnx_import/op/acosh.hpp +++ b/ngraph/src/ngraph/frontend/onnx_import/op/acosh.hpp @@ -17,6 +17,7 @@ #pragma once #include "core/node.hpp" +#include "default_opset.hpp" #include "ngraph/node.hpp" namespace ngraph @@ -27,7 +28,10 @@ namespace ngraph { namespace set_1 { - NodeVector acosh(const Node& node); + inline NodeVector acosh(const Node& node) + { + return {std::make_shared(node.get_ng_inputs().at(0))}; + } } // namespace set_1 } // namespace op diff --git a/ngraph/src/ngraph/opsets/opset4_tbl.hpp b/ngraph/src/ngraph/opsets/opset4_tbl.hpp index 83a34083dcb..1bacb26dbac 100644 --- a/ngraph/src/ngraph/opsets/opset4_tbl.hpp +++ b/ngraph/src/ngraph/opsets/opset4_tbl.hpp @@ -153,3 +153,4 @@ NGRAPH_OP(TopK, ngraph::op::v3) // New operations added in opset4 NGRAPH_OP(NonMaxSuppression, ngraph::op::v4) +NGRAPH_OP(Acosh, ngraph::op::v3) diff --git a/ngraph/test/util/engine/ie_engines.cpp b/ngraph/test/util/engine/ie_engines.cpp index 683bbc6f18b..21c3fd60fe0 100644 --- a/ngraph/test/util/engine/ie_engines.cpp +++ b/ngraph/test/util/engine/ie_engines.cpp @@ -203,6 +203,8 @@ std::set test::IE_Engine::get_ie_ops() const ie_ops.insert(opset2.begin(), opset2.end()); const auto& opset3 = get_opset3().get_type_info_set(); ie_ops.insert(opset3.begin(), opset3.end()); + const auto& opset4 = get_opset4().get_type_info_set(); + ie_ops.insert(opset4.begin(), opset4.end()); return ie_ops; }