Commit 8fdefa52 authored by tsocha's avatar tsocha Committed by Scott Cyphers

[ONNX] Pow operator (#1557)

parent 8bab36fb
......@@ -55,6 +55,7 @@ add_library(onnx_import STATIC
op/mean.hpp
op/min.hpp
op/mul.hpp
op/pow.hpp
op/relu.hpp
op/reshape.cpp
op/reshape.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/node_vector.hpp"
#include "ngraph/op/power.hpp"
#include "core/node.hpp"
#include "utils/broadcasting.hpp"
namespace ngraph
{
namespace onnx_import
{
namespace op
{
inline NodeVector pow(const Node& node)
{
NodeVector ng_inputs{
numpy_style_broadcast_for_binary_operation(node.get_ng_inputs())};
return {std::make_shared<ngraph::op::Power>(ng_inputs.at(0), ng_inputs.at(1))};
}
} // namespace op
} // namespace onnx_import
} // namespace ngraph
......@@ -33,6 +33,7 @@
#include "op/mean.hpp"
#include "op/min.hpp"
#include "op/mul.hpp"
#include "op/pow.hpp"
#include "op/relu.hpp"
#include "op/reshape.hpp"
#include "op/softmax.hpp"
......@@ -101,6 +102,7 @@ namespace ngraph
m_map.emplace("Mean", std::bind(op::mean, std::placeholders::_1));
m_map.emplace("Min", std::bind(op::min, std::placeholders::_1));
m_map.emplace("Mul", std::bind(op::mul, std::placeholders::_1));
m_map.emplace("Pow", std::bind(op::pow, std::placeholders::_1));
m_map.emplace("Relu", std::bind(op::relu, std::placeholders::_1));
m_map.emplace("Reshape", std::bind(op::reshape, std::placeholders::_1));
m_map.emplace("Softmax", std::bind(op::softmax, std::placeholders::_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