Commit 15d743f1 authored by Artur Wojcik's avatar Artur Wojcik Committed by Michał Karzyński

[ONNX] add 'Add' operator (#1192)

parent 08cabb12
......@@ -39,6 +39,7 @@ add_library(onnx_import STATIC
model.hpp
node.cpp
node.hpp
op/add.hpp
ops_bridge.cpp
ops_bridge.hpp
tensor.hpp
......
/*******************************************************************************
* Copyright 2017-2018 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.
*******************************************************************************/
#pragma once
#include "ngraph/frontend/onnx_import/node.hpp"
#include "ngraph/node_vector.hpp"
#include "ngraph/op/add.hpp"
namespace ngraph
{
namespace onnx_import
{
namespace op
{
inline NodeVector add(const Node& node)
{
NodeVector ng_inputs{node.get_ng_inputs()};
return {std::make_shared<ngraph::op::Add>(ng_inputs.at(0), ng_inputs.at(1))};
}
} // namespace op
} // namespace onnx_import
} // namespace ngrahp
......@@ -17,6 +17,7 @@
#include <algorithm>
#include <functional>
#include "ngraph/frontend/onnx_import/op/add.hpp"
#include "ops_bridge.hpp"
namespace ngraph
......@@ -37,6 +38,7 @@ namespace ngraph
} // namespace error
NodeVector add(const Node& node) { return op::add(node); }
class ops_bridge
{
public:
......@@ -59,7 +61,7 @@ namespace ngraph
return instance;
}
ops_bridge() {}
ops_bridge() { m_map.emplace("Add", std::bind(add, std::placeholders::_1)); }
NodeVector operator()(const Node& node) const
{
try
......
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