Unverified Commit 848253cc authored by Michał Karzyński's avatar Michał Karzyński Committed by GitHub

Use Add (input+0) for ONNX Identity op (#4423)

parent 18561cbb
...@@ -16,8 +16,11 @@ ...@@ -16,8 +16,11 @@
#pragma once #pragma once
#include <memory>
#include "core/node.hpp" #include "core/node.hpp"
#include "ngraph/node.hpp" #include "ngraph/node.hpp"
#include "ngraph/op/get_output_element.hpp"
namespace ngraph namespace ngraph
{ {
...@@ -29,7 +32,9 @@ namespace ngraph ...@@ -29,7 +32,9 @@ namespace ngraph
{ {
inline NodeVector identity(const Node& node) inline NodeVector identity(const Node& node)
{ {
return {node.get_ng_inputs().at(0)}; auto input = node.get_ng_inputs().at(0);
auto zero = default_opset::Constant::create(input->get_element_type(), {}, {0});
return {std::make_shared<default_opset::Add>(input, zero)};
} }
} // namespace set_1 } // namespace set_1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment