#include <ngraph/graph_util.hpp>
#include <ngraph/pass/constant_folding.hpp>
#include <ngraph/pass/manager.hpp>
-#include <ngraph/pass/get_output_element_elimination.hpp>
#include <set>
#include <string>
if (constFolding) {
ngraph::pass::ConstantFolding().run_on_function(specialized_function);
}
- // TODO: remove this code after the fix on the nGraph side
- ::ngraph::pass::GetOutputElementElimination goe_elimination;
- for (auto n : specialized_function->get_ops()) {
- goe_elimination.run_on_node(n);
- }
- specialized_function->set_friendly_name(func->get_friendly_name());
return specialized_function;
}
for (const auto& desc : tensor_iterator->get_output_descriptions()) {
auto result = results[desc->m_body_value_index]->input(0).get_source_output();
- // GetOutputElement layer can be inserted by ngraph deep copy functions
- // Take the previous layer.
- if (::ngraph::is_type<ngraph::op::GetOutputElement>(result.get_node_shared_ptr())) {
- result = result.get_node()->input(0).get_source_output();
- }
std::string name = result.get_node()->get_friendly_name();
if (result.get_node()->get_output_size() > 1) {
name += "." + std::to_string(result.get_index());
auto result = results[input_desc->m_body_value_index]->inputs()[0].get_source_output();
- // GetOutputElement layer can be inserted by ngraph deep copy functions
- // Take the previous layer.
- if (::ngraph::is_type<ngraph::op::GetOutputElement>(result.get_node_shared_ptr())) {
- result = result.get_node()->input(0).get_source_output();
- }
// Create correct name for output.
std::string output_name = result.get_node()->get_friendly_name();
if (result.get_node()->get_output_size() > 1) {
auto argmaxNode = std::make_shared<opset1::TopK>(convNode, k, axis, mode, sort);
argmaxNode->set_friendly_name("TopK_1");
- auto goe0 = make_shared<op::GetOutputElement>(argmaxNode, 0);
- auto goe1 = make_shared<op::GetOutputElement>(argmaxNode, 1);
-
// convolution
std::shared_ptr<ngraph::opset1::Constant> weightsNode2 = nullptr;
ngraph::Shape convFilterShape2 = { 1, 1, 3, 3 }; // out channel, /input channels, kernel h, kernel w
}
std::shared_ptr<ngraph::Node> convNode2 = std::make_shared<ngraph::opset1::Convolution>(
- goe0, weightsNode2,
+ argmaxNode->output(0), weightsNode2->output(0),
ngraph::Strides({ 1, 1 }), // strides
ngraph::CoordinateDiff({ 0, 0 }), // pad begin
ngraph::CoordinateDiff({ 0, 0 }), // pad end
ngraph::op::PadType::EXPLICIT); // pad type
convNode2->set_friendly_name("Convolution_2");
- return std::make_shared<ngraph::Function>(ngraph::NodeVector{convNode2, goe1}, ngraph::ParameterVector{input1});
+ return std::make_shared<ngraph::Function>(ngraph::OutputVector{convNode2->output(0), argmaxNode->output(1)}, ngraph::ParameterVector{input1});
}
void SetUp() override {
std::tie(inputPrecision, netPrecision, inputShapes, newInputShapes, targetDevice) = this->GetParam();
const auto op_type = std::string(op->get_type_name());
count_topk += (op_type == "TopK" ? 1 : 0);
count_constants += (op_type == "Constant" ? 1 : 0);
- count_goe += (op_type == "GetOutputElement" ? 1 : 0);
count_parameters += (op_type == "Parameter" ? 1 : 0);
}
ASSERT_EQ(function->get_output_shape(1), ngraph::Shape({3, 3}));
ASSERT_EQ(count_topk, 1);
ASSERT_EQ(count_constants, 1);
- ASSERT_EQ(count_goe, 2);
ASSERT_EQ(count_parameters, 1);
}
#include "ngraph/opsets/opset.hpp"
// nGraph passes
-#include "ngraph/pass/get_output_element_elimination.hpp"
#include "ngraph/pass/graph_rewrite.hpp"
#include "ngraph/pass/manager.hpp"
#include "ngraph/pass/visualize_tree.hpp"
/// Returns the partial shape for output i
const PartialShape& get_output_partial_shape(size_t i) const;
- /// Second argument is ignored
- /// Returns the node if i=0 and the node has 1 output, otherwise a GetOutputElement
- /// If the node is a GetOutputElement, applies to the underlying node
- std::shared_ptr<Node> get_output_as_single_output_node(size_t i);
-
/// Return the output to use when converting to an Output<Node> with no index specified.
/// Throws when not supported.
Output<const Node> get_default_output() const;
template <>
class NGRAPH_API Output<Node>
{
- NGRAPH_DEPRECATED("Remove when GetOrderedOutput is removed")
- void eliminate_goe();
-
public:
/// \brief Constructs a Output.
/// \param node A pointer to the node for the output handle.
///
/// TODO: Make a plan to deprecate this.
std::shared_ptr<Node> get_node_shared_ptr() const;
- /// \return A useable shared pointer to this output. If index 0, the node,
- /// otherwise find or create a GOE.
- NGRAPH_DEPRECATED("Transitional.")
- std::shared_ptr<Node> as_single_output_node() const;
/// \return The index of the output referred to by this output handle.
size_t get_index() const;
template <>
class NGRAPH_API Output<const Node>
{
- void eliminate_goe();
-
public:
/// \brief Constructs a Output.
/// \param node A pointer to the node for the output handle.
+++ /dev/null
-//*****************************************************************************
-// 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.
-//*****************************************************************************
-
-#pragma once
-
-#include "ngraph/op/op.hpp"
-
-namespace ngraph
-{
- namespace op
- {
- NGRAPH_API
- NodeVector get_output_elements(const std::shared_ptr<Node>& mon);
-
- namespace v0
- {
- /// \brief Operation to get an output from a node.
- class NGRAPH_API GetOutputElement : public Op
- {
- public:
- static constexpr NodeTypeInfo type_info{"GetOutputElement", 0};
- const NodeTypeInfo& get_type_info() const override { return type_info; }
- GetOutputElement() = default;
- /// \brief Constructs a get-tuple-element operation.
- ///
- /// \param arg The input tuple.
- /// \param n The index of the tuple element to get.
- GetOutputElement(const std::shared_ptr<Node>& arg, size_t n);
-
- /// Return the equilent Output<Node>
- Output<Node> get_as_output() const;
-
- std::shared_ptr<Node>
- clone_with_new_inputs(const OutputVector& inputs) const override;
- void validate_and_infer_types() override;
-
- /// \return The index of the tuple element to get.
- size_t get_n() const { return m_n; }
- protected:
- size_t m_n;
- };
- }
- using v0::GetOutputElement;
- }
-
- inline std::shared_ptr<Node> get_output_element(const Output<Node>& output)
- {
- return output.get_node_shared_ptr()->get_output_as_single_output_node(output.get_index());
- }
-
- inline std::shared_ptr<Node> get_output_element(const std::shared_ptr<Node> node, size_t i = 0)
- {
- return node->get_output_as_single_output_node(i);
- }
-}
NGRAPH_OP(GatherND, ngraph::op::v0, 0)
NGRAPH_OP(GatherTree, ngraph::op::v1, 1)
NGRAPH_OP(Gelu, ngraph::op::v0, 0)
-NGRAPH_OP(GetOutputElement, ngraph::op::v0, 0)
NGRAPH_OP(Greater, ngraph::op::v0, 0)
NGRAPH_OP(Greater, ngraph::op::v1, 1)
NGRAPH_OP(GreaterEq, ngraph::op::v0, 0)
#include "ngraph/op/gather.hpp"
#include "ngraph/op/gather_nd.hpp"
#include "ngraph/op/gather_tree.hpp"
-#include "ngraph/op/get_output_element.hpp"
#include "ngraph/op/greater.hpp"
#include "ngraph/op/greater_eq.hpp"
#include "ngraph/op/group_conv.hpp"
+++ /dev/null
-//*****************************************************************************
-// 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.
-//*****************************************************************************
-
-#pragma once
-
-#include "ngraph/pass/pass.hpp"
-
-namespace ngraph
-{
- namespace pass
- {
- class GetOutputElementElimination;
- }
-}
-
-NGRAPH_SUPPRESS_DEPRECATED_START
-class NGRAPH_API ngraph::pass::GetOutputElementElimination : public NodePass
-{
-public:
- NGRAPH_RTTI_DECLARATION;
-
- bool run_on_node(std::shared_ptr<Node> node) override;
-};
-NGRAPH_SUPPRESS_DEPRECATED_END
OutputVector& get_matched_values() { return m_matched_list; }
void reset() {}
const std::string& get_name() { return m_name; }
- std::shared_ptr<Node> get_pattern()
- {
- NGRAPH_SUPPRESS_DEPRECATED_START
- return m_pattern_node.as_single_output_node();
- NGRAPH_SUPPRESS_DEPRECATED_END
- }
+ std::shared_ptr<Node> get_pattern() { return m_pattern_node.get_node_shared_ptr(); }
Output<Node> get_pattern_value() { return m_pattern_node; }
std::shared_ptr<Node> get_match_root();
Output<Node> get_match_value();
: AnyOf(type,
s,
[pred](const Output<Node>& value) {
- NGRAPH_SUPPRESS_DEPRECATED_START
- return pred(value.as_single_output_node());
- NGRAPH_SUPPRESS_DEPRECATED_END
+ return pred(value.get_node_shared_ptr());
},
as_output_vector(wrapped_values))
{
const Shape& output_shape,
const Shape& source_shape)
{
- NGRAPH_SUPPRESS_DEPRECATED_START
- shared_ptr<Node> broadcasted_node = value.as_single_output_node();
- NGRAPH_SUPPRESS_DEPRECATED_END
+ shared_ptr<Node> broadcasted_node = value.get_node_shared_ptr();
// If node already has the required shape, return original node
if (output_shape == value.get_shape())
{
// If node already has the required shape, return original node
if (output_shape == value_shape)
{
- NGRAPH_SUPPRESS_DEPRECATED_START
- return value.as_single_output_node();
- NGRAPH_SUPPRESS_DEPRECATED_END
+ return value.get_node_shared_ptr();
}
if (axis == -1)
// Handle the trivial case...
if (arg1_in_shape == arg2_in_shape)
{
- NGRAPH_SUPPRESS_DEPRECATED_START
- return make_pair(args.first.as_single_output_node(),
- args.second.as_single_output_node());
- NGRAPH_SUPPRESS_DEPRECATED_END
+ return make_pair(args.first.get_node_shared_ptr(),
+ args.second.get_node_shared_ptr());
}
NodeVector bcasted_outputs =
//*****************************************************************************
#include "ngraph/builder/split.hpp"
-#include "ngraph/op/get_output_element.hpp"
#include "ngraph/op/slice.hpp"
#include "ngraph/opsets/opset1.hpp"
#include "ngraph/itt.hpp"
#include "ngraph/node.hpp"
#include "ngraph/op/constant.hpp"
-#include "ngraph/op/get_output_element.hpp"
#include "ngraph/op/parameter.hpp"
#include "ngraph/op/result.hpp"
#include "ngraph/pattern/matcher.hpp"
return copy_with_new_inputs(inputs, get_control_dependencies());
}
-std::shared_ptr<Node> Node::get_output_as_single_output_node(size_t i)
-{
- if (i == 0 && get_output_size() == 1)
- {
- return shared_from_this();
- }
- else
- {
- for (auto in : output(i).get_target_inputs())
- {
- if (is_type<op::GetOutputElement>(in.get_node()))
- {
- return in.get_node()->shared_from_this();
- }
- }
- return make_shared<op::GetOutputElement>(shared_from_this(), i);
- }
-}
-
Output<const Node> Node::get_default_output() const
{
return output(get_default_output_index());
#include "ngraph/node_output.hpp"
#include "ngraph/log.hpp"
#include "ngraph/node.hpp"
-#include "ngraph/op/get_output_element.hpp"
namespace ngraph
{
: m_node(node->shared_from_this())
, m_index(index)
{
- NGRAPH_SUPPRESS_DEPRECATED_START
- eliminate_goe();
- NGRAPH_SUPPRESS_DEPRECATED_END
}
Output<Node>::Output(const std::shared_ptr<Node>& node, size_t index)
: m_node(node)
, m_index(index)
{
- NGRAPH_SUPPRESS_DEPRECATED_START
- eliminate_goe();
- NGRAPH_SUPPRESS_DEPRECATED_END
}
void Output<Node>::reset()
}
Node* Output<Node>::get_node() const { return m_node.get(); }
std::shared_ptr<Node> Output<Node>::get_node_shared_ptr() const { return m_node; }
- std::shared_ptr<Node> Output<Node>::as_single_output_node() const
- {
- return m_node->get_output_as_single_output_node(m_index);
- }
-
size_t Output<Node>::get_index() const { return m_index; }
descriptor::Tensor& Output<Node>::get_tensor() const
{
{
for (auto& input : get_target_inputs())
{
- // GOEs are used as handles in passes
- if (!is_type<op::GetOutputElement>(input.get_node()))
- {
- input.replace_source_output(replacement);
- }
+ input.replace_source_output(replacement);
}
}
}
bool Output<Node>::operator<=(const Output& other) const { return !(*this > other); }
bool Output<Node>::operator>=(const Output& other) const { return !(*this < other); }
- void Output<Node>::eliminate_goe()
- {
- while (is_type<op::GetOutputElement>(m_node))
- {
- *this = m_node->input_value(0);
- }
- }
-
Output<const Node>::Output(const Node* node, size_t index)
: m_node(node->shared_from_this())
, m_index(index)
{
- eliminate_goe();
}
Output<const Node>::Output(const std::shared_ptr<const Node>& node, size_t index)
: m_node(node)
, m_index(index)
{
- eliminate_goe();
}
void Output<const Node>::reset()
}
bool Output<const Node>::operator<=(const Output& other) const { return !(*this > other); }
bool Output<const Node>::operator>=(const Output& other) const { return !(*this < other); }
- void Output<const Node>::eliminate_goe()
- {
- while (is_type<const op::GetOutputElement>(m_node))
- {
- auto value = m_node->input_value(0);
- m_node = value.get_node_shared_ptr();
- m_index = value.get_index();
- }
- }
-
std::ostream& operator<<(std::ostream& out, const Output<Node>& output)
{
return output.get_node()->write_description(out, 0) << "[" << output.get_index()
#include "ngraph/attribute_visitor.hpp"
#include "ngraph/op/batch_norm.hpp"
-#include "ngraph/op/get_output_element.hpp"
#include "ngraph/validation_util.hpp"
using namespace std;
+++ /dev/null
-//*****************************************************************************
-// 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 <sstream>
-
-#include "ngraph/op/get_output_element.hpp"
-
-using namespace std;
-using namespace ngraph;
-
-constexpr NodeTypeInfo op::GetOutputElement::type_info;
-
-op::GetOutputElement::GetOutputElement(const shared_ptr<Node>& arg, size_t n)
- : Op({arg->output(n)})
- , m_n{n}
-{
- constructor_validate_and_infer_types();
-}
-
-void op::GetOutputElement::validate_and_infer_types()
-{
- NODE_VALIDATION_CHECK(this,
- m_n < input_value(0).get_node()->get_output_size(),
- "Output at index ",
- m_n,
- " requested, but node has only ",
- get_input_size(),
- " inputs.");
-
- set_output_type(0, get_input_element_type(0), get_input_partial_shape(0));
-}
-
-shared_ptr<Node> op::GetOutputElement::clone_with_new_inputs(const OutputVector& inputs) const
-{
- auto& value = inputs.at(0);
- return make_shared<op::GetOutputElement>(value.get_node_shared_ptr(), value.get_index());
-}
-
-Output<Node> op::GetOutputElement::get_as_output() const
-{
- return input_value(0);
-}
-
-NodeVector op::get_output_elements(const shared_ptr<Node>& mon)
-{
- NodeVector goes(mon->get_output_size());
- for (auto o : mon->outputs())
- {
- NGRAPH_SUPPRESS_DEPRECATED_START
- goes.at(o.get_index()) = o.as_single_output_node();
- NGRAPH_SUPPRESS_DEPRECATED_END
- }
- return goes;
-}
#include "ngraph/op/tensor_iterator.hpp"
#include "ngraph/factory.hpp"
#include "ngraph/graph_util.hpp"
-#include "ngraph/pass/get_output_element_elimination.hpp"
#include "ngraph/specialize_function.hpp"
using namespace std;
op->m_body =
std::make_shared<BodyLambda>(spec_func->get_results(), spec_func->get_parameters());
- // TODO: remove this code after the fix on the nGraph side (GetOutputElements)
- ::ngraph::pass::GetOutputElementElimination goe_elimination;
- for (const auto& n : spec_func->get_ops())
- {
- goe_elimination.run_on_node(n);
- }
-
for (auto& input_description : m_input_descriptions)
{
op->m_input_descriptions.push_back(input_description->copy());
{
if (m_clip == 0.f)
{
- NGRAPH_SUPPRESS_DEPRECATED_START
- return data.as_single_output_node();
- NGRAPH_SUPPRESS_DEPRECATED_END
+ return data.get_node_shared_ptr();
}
return make_shared<op::Clamp>(data, -m_clip, m_clip);
+++ /dev/null
-//*****************************************************************************
-// 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 <set>
-
-#include "get_output_element_elimination.hpp"
-#include "ngraph/graph_util.hpp"
-#include "ngraph/log.hpp"
-#include "ngraph/op/avg_pool.hpp"
-#include "ngraph/op/broadcast.hpp"
-#include "ngraph/op/constant.hpp"
-#include "ngraph/op/convolution.hpp"
-#include "ngraph/op/get_output_element.hpp"
-#include "ngraph/op/max_pool.hpp"
-#include "ngraph/op/pad.hpp"
-#include "ngraph/op/product.hpp"
-#include "ngraph/op/sum.hpp"
-
-using namespace ngraph;
-using namespace std;
-
-NGRAPH_RTTI_DEFINITION(ngraph::pass::GetOutputElementElimination,
- "ngraph::pass::GetOutputElementElimination",
- 0);
-
-bool pass::GetOutputElementElimination::run_on_node(shared_ptr<Node> n)
-{
- bool optimized = false;
- for (auto& input : n->inputs())
- {
- if (auto goe = dynamic_cast<op::GetOutputElement*>(input.get_source_output().get_node()))
- {
- input.replace_source_output(goe->input_value(0));
- // we don't need to fix anything w.r.t GetOutputElement as it will become unreachable
- optimized = true;
- }
- }
- return optimized;
-}
#include "ngraph/graph_util.hpp"
#include "ngraph/node.hpp"
#include "ngraph/op/constant.hpp"
-#include "ngraph/op/get_output_element.hpp"
#include "ngraph/op/parameter.hpp"
#include "ngraph/op/util/op_types.hpp"
#include "ngraph/pass/pass.hpp"
if (getenv_bool("NGRAPH_VISUALIZE_EDGE_LABELS"))
{
size_t output = 0;
- if (auto goe = as_type_ptr<op::GetOutputElement>(dst))
- {
- output = goe->get_as_output().get_index();
- }
stringstream label_edge;
label_edge << "[label=\" " << output << " -> " << arg_index << " \"]";
ss << label_edge.str();
#include "ngraph/env_util.hpp"
#include "ngraph/graph_util.hpp"
#include "ngraph/log.hpp"
-#include "ngraph/op/get_output_element.hpp"
#include "ngraph/op/parameter.hpp"
#include "ngraph/op/util/op_types.hpp"
#include <memory>
#include "ngraph/node.hpp"
-#include "ngraph/op/get_output_element.hpp"
#include "onnx_import/core/node.hpp"
+#include "onnx_import/default_opset.hpp"
namespace ngraph
{
OutputVector node_outputs;
for (const auto& v : final_values)
{
- NGRAPH_SUPPRESS_DEPRECATED_START
- node_outputs.push_back(v.as_single_output_node());
- NGRAPH_SUPPRESS_DEPRECATED_END
+ node_outputs.push_back(v);
}
for (const auto& v : scan_outputs)
{
- NGRAPH_SUPPRESS_DEPRECATED_START
- node_outputs.push_back(v.as_single_output_node());
- NGRAPH_SUPPRESS_DEPRECATED_END
+ node_outputs.push_back(v);
}
return node_outputs;
}
#include "ngraph/op/add.hpp"
#include "ngraph/op/constant.hpp"
#include "ngraph/op/fused/lstm_sequence.hpp"
-#include "ngraph/op/get_output_element.hpp"
#include "ngraph/op/util/attr_types.hpp"
#include "ngraph/shape.hpp"
#include "ngraph/type/element_type.hpp"
auto split_axis = default_opset::Constant::create(element::i64, {}, {0});
auto off_on_values =
std::make_shared<default_opset::Split>(values, split_axis, 2);
- auto off_value =
- reshape::interpret_as_scalar(get_output_element(off_on_values, size_t{0}));
- auto on_value =
- reshape::interpret_as_scalar(get_output_element(off_on_values, size_t{1}));
+ auto off_value = reshape::interpret_as_scalar(off_on_values->output(0));
+ auto on_value = reshape::interpret_as_scalar(off_on_values->output(1));
auto axis = node.get_attribute_value<std::int64_t>("axis", -1);
//*****************************************************************************
#include "onnx_import/utils/arg_min_max_factory.hpp"
-#include "ngraph/op/get_output_element.hpp"
#include "ngraph/validation_util.hpp"
#include "onnx_import/default_opset.hpp"
type_prop/gather.cpp
type_prop/gather_nd.cpp
type_prop/gather_tree.cpp
- type_prop/get_output_element.cpp
type_prop/grn.cpp
type_prop/group_convolution.cpp
type_prop/group_convolution_backprop_data.cpp
#include "ngraph/op/constant.hpp"
#include "ngraph/op/divide.hpp"
#include "ngraph/op/exp.hpp"
-#include "ngraph/op/get_output_element.hpp"
#include "ngraph/op/log.hpp"
#include "ngraph/op/multiply.hpp"
#include "ngraph/op/negative.hpp"
const auto lstm_cell = make_shared<op::LSTMCell>(
X, H_t, C_t, W, R, B, P, hidden_size, op::LSTMWeightsFormat::IOFC);
- auto ht_function = make_shared<Function>(make_shared<op::GetOutputElement>(lstm_cell, 0),
+ auto ht_function = make_shared<Function>(OutputVector{lstm_cell->output(0)},
ParameterVector{X, H_t, C_t, W, R, B, P});
auto ht_test_case = test::TestCase<TestEngine>(ht_function);
{0.81457126f, 0.61109227f, 0.769522f, 0.52239674f, 0.4324641f, 0.63183f});
ht_test_case.run();
- auto ct_function = make_shared<Function>(make_shared<op::GetOutputElement>(lstm_cell, 1),
+ auto ct_function = make_shared<Function>(OutputVector{lstm_cell->output(1)},
ParameterVector{X, H_t, C_t, W, R, B, P});
auto ct_test_case = test::TestCase<TestEngine>(ct_function);
ct_test_case.add_multiple_inputs(
const auto lstm_cell = make_shared<op::LSTMCell>(
X, H_t, C_t, W, R, B, P, hidden_size, op::LSTMWeightsFormat::IOFC);
- auto ht_function = make_shared<Function>(make_shared<op::GetOutputElement>(lstm_cell, 0),
+ auto ht_function = make_shared<Function>(OutputVector{lstm_cell->output(0)},
ParameterVector{X, H_t, C_t, W, R, B, P});
auto ht_test_case = test::TestCase<TestEngine>(ht_function);
{0.9218244f, 0.78787273f, 0.8754273f, 0.7361462f, 0.70927656f, 0.83522964f});
ht_test_case.run();
- auto ct_function = make_shared<Function>(make_shared<op::GetOutputElement>(lstm_cell, 1),
+ auto ct_function = make_shared<Function>(OutputVector{lstm_cell->output(1)},
ParameterVector{X, H_t, C_t, W, R, B, P});
auto ct_test_case = test::TestCase<TestEngine>(ct_function);
ct_test_case.add_multiple_inputs(
vector<float>{},
clip_threshold,
input_forget);
- auto ht_function = make_shared<Function>(make_shared<op::GetOutputElement>(lstm_cell, 0),
+ auto ht_function = make_shared<Function>(OutputVector{lstm_cell->output(0)},
ParameterVector{X, H_t, C_t, W, R, B, P});
auto ht_test_case = test::TestCase<TestEngine>(ht_function);
{0.71485436f, 0.71844107f, 0.72704613f, 0.6235602f, 0.68306124f, 0.6978715f});
ht_test_case.run();
- auto ct_function = make_shared<Function>(make_shared<op::GetOutputElement>(lstm_cell, 1),
+ auto ct_function = make_shared<Function>(OutputVector{lstm_cell->output(1)},
ParameterVector{X, H_t, C_t, W, R, B, P});
auto ct_test_case = test::TestCase<TestEngine>(ct_function);
ct_test_case.add_multiple_inputs(
activation_beta,
clip_threshold,
input_forget);
- auto ht_function = make_shared<Function>(make_shared<op::GetOutputElement>(lstm_cell, 0),
+ auto ht_function = make_shared<Function>(OutputVector{lstm_cell->output(0)},
ParameterVector{X, H_t, C_t, W, R, B, P});
auto ht_test_case = test::TestCase<TestEngine>(ht_function);
{0.96834344f, 0.9695254f, 0.97068775f, 0.9077866f, 0.94161016f, 0.96599925f});
ht_test_case.run();
- auto ct_function = make_shared<Function>(make_shared<op::GetOutputElement>(lstm_cell, 1),
+ auto ct_function = make_shared<Function>(OutputVector{lstm_cell->output(1)},
ParameterVector{X, H_t, C_t, W, R, B, P});
auto ct_test_case = test::TestCase<TestEngine>(ct_function);
ct_test_case.add_multiple_inputs(
#include "gtest/gtest.h"
#include "ngraph/op/constant.hpp"
-#include "ngraph/op/get_output_element.hpp"
#include "ngraph/op/parameter.hpp"
#include "ngraph/op/result.hpp"
#include "ngraph/op/topk.hpp"
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 1, element::i32, 5, true);
auto C = make_shared<op::TopK>(A, 1, element::i32, 1, true);
- auto out5_value = make_shared<op::GetOutputElement>(B, 1);
- auto out5_index = make_shared<op::GetOutputElement>(B, 0);
- auto out1_value = make_shared<op::GetOutputElement>(C, 1);
- auto out1_index = make_shared<op::GetOutputElement>(C, 0);
- auto f = make_shared<Function>(NodeVector{out5_value, out5_index, out1_value, out1_index},
+ auto out5_value = B->output(1);
+ auto out5_index = B->output(0);
+ auto out1_value = C->output(1);
+ auto out1_index = C->output(0);
+ auto f = make_shared<Function>(OutputVector{out5_value, out5_index, out1_value, out1_index},
ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{128, 5};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 1, element::i32, 5, true, op::TopK::SortType::NONE);
- auto out_value = make_shared<op::GetOutputElement>(B, 1);
- auto out_index = make_shared<op::GetOutputElement>(B, 0);
- auto f = make_shared<Function>(NodeVector{out_value, out_index}, ParameterVector{A});
+ auto out_value = B->output(1);
+ auto out_index = B->output(0);
+ auto f = make_shared<Function>(OutputVector{out_value, out_index}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{128, 5};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 1, element::i32, 5, false, op::TopK::SortType::NONE);
- auto out_value = make_shared<op::GetOutputElement>(B, 1);
- auto out_index = make_shared<op::GetOutputElement>(B, 0);
- auto f = make_shared<Function>(NodeVector{out_value, out_index}, ParameterVector{A});
+ auto out_value = B->output(1);
+ auto out_index = B->output(0);
+ auto f = make_shared<Function>(OutputVector{out_value, out_index}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{128, 5};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 1, element::i32, 5, true, op::TopK::SortType::SORT_VALUES);
- auto out_value = make_shared<op::GetOutputElement>(B, 1);
- auto out_index = make_shared<op::GetOutputElement>(B, 0);
- auto f = make_shared<Function>(NodeVector{out_value, out_index}, ParameterVector{A});
+ auto out_value = B->output(1);
+ auto out_index = B->output(0);
+ auto f = make_shared<Function>(OutputVector{out_value, out_index}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{128, 5};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 1, element::i32, 5, false, op::TopK::SortType::SORT_VALUES);
- auto out_value = make_shared<op::GetOutputElement>(B, 1);
- auto out_index = make_shared<op::GetOutputElement>(B, 0);
- auto f = make_shared<Function>(NodeVector{out_value, out_index}, ParameterVector{A});
+ auto out_value = B->output(1);
+ auto out_index = B->output(0);
+ auto f = make_shared<Function>(OutputVector{out_value, out_index}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{128, 5};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 1, element::i32, 5, true, op::TopK::SortType::SORT_INDICES);
- auto out_value = make_shared<op::GetOutputElement>(B, 1);
- auto out_index = make_shared<op::GetOutputElement>(B, 0);
- auto f = make_shared<Function>(NodeVector{out_value, out_index}, ParameterVector{A});
+ auto out_value = B->output(1);
+ auto out_index = B->output(0);
+ auto f = make_shared<Function>(OutputVector{out_value, out_index}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{128, 5};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 1, element::i32, 5, false, op::TopK::SortType::SORT_INDICES);
- auto out_value = make_shared<op::GetOutputElement>(B, 1);
- auto out_index = make_shared<op::GetOutputElement>(B, 0);
- auto f = make_shared<Function>(NodeVector{out_value, out_index}, ParameterVector{A});
+ auto out_value = B->output(1);
+ auto out_index = B->output(0);
+ auto f = make_shared<Function>(OutputVector{out_value, out_index}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{6};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 0, element::i32, 0, true);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{6};
auto A = make_shared<op::Parameter>(element::i32, shape);
auto B = make_shared<op::TopK>(A, 0, element::i32, 0, true);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{3};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 0, element::i32, 3, true);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{1};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 0, element::i32, 1, true);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{6};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 0, element::i32, 0, false);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{3};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 0, element::i32, 3, false);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{1};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 0, element::i32, 1, false);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{2, 3, 2};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 1, element::i32, 0, true);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{2, 3, 2};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 1, element::i64, 0, true);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{2, 2, 3, 2, 4};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 1, element::i32, 2, true);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 1, element::i32, 2, true);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{2, 1, 2};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 1, element::i32, 1, true);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{2, 3, 2};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 1, element::i32, 0, false);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 1, element::i32, 2, false);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{2, 1, 2};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 1, element::i32, 1, false);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{4, 3};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 0, element::i32, 4, true);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{2, 3};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 0, element::i32, 2, true);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{1, 3};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 0, element::i32, 1, true);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{2, 1};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 1, element::i32, 1, true);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{4, 3};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 0, element::i32, 4, false);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{2, 3};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 0, element::i32, 2, false);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
Shape rshape{1, 3};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 0, element::i32, 1, false);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto f1 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto f1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
auto B = make_shared<op::TopK>(A, 1, element::i32, 10, true);
- auto interp_f_0 =
- make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto interp_f_1 =
- make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto interp_f_0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto interp_f_1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto gpu_f_0 = ngraph::clone_function(*interp_f_0);
auto gpu_f_1 = ngraph::clone_function(*interp_f_1);
auto B = make_shared<op::TopK>(A, 1, element::i32, 10, false);
- auto interp_f_0 =
- make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
- auto interp_f_1 =
- make_shared<Function>(make_shared<op::GetOutputElement>(B, 1), ParameterVector{A});
+ auto interp_f_0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
+ auto interp_f_1 = make_shared<Function>(OutputVector{B->output(1)}, ParameterVector{A});
auto gpu_f_0 = ngraph::clone_function(*interp_f_0);
auto gpu_f_1 = ngraph::clone_function(*interp_f_1);
Shape rshape{2, 2, 2};
auto A = make_shared<op::Parameter>(element::f32, shape);
auto B = make_shared<op::TopK>(A, 1, element::i32, 2, false);
- auto f0 = make_shared<Function>(make_shared<op::GetOutputElement>(B, 0), ParameterVector{A});
+ auto f0 = make_shared<Function>(OutputVector{B->output(0)}, ParameterVector{A});
auto backend = runtime::Backend::create("${BACKEND_NAME}");
#include "ngraph/log.hpp"
#include "ngraph/ngraph.hpp"
#include "ngraph/op/batch_norm.hpp"
-#include "ngraph/op/get_output_element.hpp"
#include "ngraph/op/parameter.hpp"
#include "ngraph/pass/manager.hpp"
#include "ngraph/pass/visualize_tree.hpp"
EXPECT_FALSE(op::is_binary_elementwise_logical(&node));
}
- void op_is_GetOutputElement()
- {
- op::GetOutputElement node;
- EXPECT_FALSE(op::is_unary_elementwise_arithmetic(&node));
- EXPECT_FALSE(op::is_binary_elementwise_arithmetic(&node));
- EXPECT_FALSE(op::is_binary_elementwise_comparison(&node));
- EXPECT_FALSE(op::is_binary_elementwise_logical(&node));
- }
-
void op_is_Greater()
{
op::Greater node;
ASSERT_EQ(z_replacement->get_input_node_shared_ptr(0), x_replacement);
ASSERT_EQ(z_replacement->get_input_node_shared_ptr(1), mul);
}
-
-TEST(replace_node, replace_nodes_output_order)
-{
- auto data = make_shared<op::Parameter>(element::f16, Shape{4, 3});
- auto topk_v0 = make_shared<op::v0::TopK>(data, 0, element::i32, 2, true);
-
- auto topk_v1 = make_shared<op::v1::TopK>(data,
- op::Constant::create(element::i32, Shape{}, {2}),
- 0,
- op::v1::TopK::Mode::MAX,
- op::v1::TopK::SortType::SORT_VALUES,
- element::i32);
-
- auto values = make_shared<op::GetOutputElement>(topk_v1, 0);
- auto indices = make_shared<op::GetOutputElement>(topk_v1, 1);
-
- ASSERT_EQ(values->get_input_element_type(0), element::f16);
- ASSERT_EQ(indices->get_input_element_type(0), element::i32);
-
- std::vector<int64_t> output_order{1, 0};
- replace_node(topk_v1, topk_v0, output_order);
-
- ASSERT_EQ(values->get_input_element_type(0), element::f16);
- ASSERT_EQ(indices->get_input_element_type(0), element::i32);
-}
-
-TEST(replace_node, replace_nodes_output_order_incorrect_size)
-{
- auto data = make_shared<op::Parameter>(element::f16, Shape{4, 3});
- auto topk_v0 = make_shared<op::v0::TopK>(data, 0, element::i32, 2, true);
-
- auto topk_v1 = make_shared<op::v1::TopK>(data,
- op::Constant::create(element::i32, Shape{}, {2}),
- 0,
- op::v1::TopK::Mode::MAX,
- op::v1::TopK::SortType::SORT_VALUES,
- element::i32);
-
- auto values = make_shared<op::GetOutputElement>(topk_v1, 0);
- auto indices = make_shared<op::GetOutputElement>(topk_v1, 1);
-
- std::vector<int64_t> output_order{2, 1, 0};
- try
- {
- replace_node(topk_v1, topk_v0, output_order);
- FAIL() << "Incorrect output order size exception not detected";
- }
- catch (const ngraph_error& error)
- {
- EXPECT_HAS_SUBSTRING(error.what(), std::string("Target output size: "));
- }
- catch (...)
- {
- FAIL() << "Incorrect output order size exception not thrown for unexpected reason";
- }
-}
#include "ie_tensor.hpp"
#include "ngraph/graph_util.hpp"
#include "ngraph/log.hpp"
-#include "ngraph/op/get_output_element.hpp"
#include "ngraph/opsets/opset.hpp"
#include "ngraph/util.hpp"
bool runtime::ie::IE_Backend::is_supported(const Node& node) const
{
const auto& opset = get_opset1();
- if (node.get_type_info() == op::GetOutputElement::type_info)
- {
- // IE currently can handle this op
- return true;
- }
- else
- {
- return opset.contains_op_type(&node);
- }
+ return opset.contains_op_type(&node);
}
shared_ptr<runtime::Tensor>
#include "ie_executable.hpp"
#include "ie_tensor.hpp"
-#include "ngraph/op/get_output_element.hpp"
#include "ngraph/opsets/opset.hpp"
#include "ngraph/pass/manager.hpp"
#include "ngraph/shape.hpp"
{
if (ie_ops.find(node->get_type_info()) == ie_ops.end())
{
- if (node->get_type_info() == op::GetOutputElement::type_info)
- {
- // IE currently can handle GetOutuputElement op;
- continue;
- }
- else
- {
- cout << "UNSUPPORTED OP DETECTED: " << node->get_type_info().name << endl;
- THROW_IE_EXCEPTION << "Detected op not belonging to opset1!";
- }
+ cout << "UNSUPPORTED OP DETECTED: " << node->get_type_info().name << endl;
+ THROW_IE_EXCEPTION << "Detected op not belonging to opset1!";
}
}
avg_pool->get_include_padding_in_avg_computation());
break;
}
- case OP_TYPEID::GetOutputElement:
- {
- size_t element_count = shape_size(node.get_output_shape(0));
- size_t num_bytes = element_count * node.get_output_element_type(0).size();
- std::memcpy(out[0]->get_data_ptr<T>(), args[0]->get_data_ptr<T>(), num_bytes);
- break;
- }
case OP_TYPEID::BatchNormInference:
{
const ngraph::op::BatchNormInference* bn =
NGRAPH_OP(Gather, ngraph::op)
NGRAPH_OP(GatherND, ngraph::op)
NGRAPH_OP(Gelu, ngraph::op)
-NGRAPH_OP(GetOutputElement, ngraph::op)
NGRAPH_OP(Greater, ngraph::op)
NGRAPH_OP(GreaterEq, ngraph::op)
NGRAPH_OP(GroupConvolution, ngraph::op::v0)
//*****************************************************************************
#include "fused_op_decomposition.hpp"
#include "ngraph/graph_util.hpp"
-#include "ngraph/op/get_output_element.hpp"
#include "ngraph/op/util/op_types.hpp"
#include "ngraph/provenance.hpp"
std::set<Input<Node>> fop_users = node->outputs().at(i).get_target_inputs();
for (auto fop_user : fop_users)
{
- if (auto goe = as_type<op::GetOutputElement>(fop_user.get_node()))
- {
- Output<Node> goe_output = goe->get_as_output();
- if (goe_output.get_index() == i &&
- !goe->output(0).get_target_inputs().empty())
- {
- // Replace GOE users
- std::set<Input<Node>> goe_users =
- goe->outputs().at(0).get_target_inputs();
- for (auto goe_user : goe_users)
- {
- goe_user.replace_source_output(output_node->output(j));
- }
- }
- }
- else
- {
- fop_user.replace_source_output(output_node->output(j));
- }
+ fop_user.replace_source_output(output_node->output(j));
}
}
}
+++ /dev/null
-//*****************************************************************************
-// 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 "gtest/gtest.h"
-#include "ngraph/ngraph.hpp"
-#include "util/type_prop.hpp"
-
-using namespace std;
-using namespace ngraph;
-
-TEST(type_prop, get_output_element_partial_et_dynamic)
-{
- auto a = make_shared<op::Parameter>(element::dynamic, Shape{1, 2, 3, 4});
- auto b = make_shared<op::Parameter>(element::dynamic, Shape{1, 2, 3, 4});
- auto add = make_shared<op::Add>(a, b);
- auto goe = make_shared<op::GetOutputElement>(add, 0);
-
- ASSERT_EQ(goe->get_output_element_type(0), element::dynamic);
- ASSERT_EQ(goe->get_output_shape(0), (Shape{1, 2, 3, 4}));
-}
-
-TEST(type_prop, get_output_element_partial_rank_dynamic)
-{
- auto a = make_shared<op::Parameter>(element::i32, PartialShape::dynamic());
- auto b = make_shared<op::Parameter>(element::i32, PartialShape::dynamic());
- auto add = make_shared<op::Add>(a, b);
- auto goe = make_shared<op::GetOutputElement>(add, 0);
-
- ASSERT_EQ(goe->get_output_element_type(0), element::i32);
- ASSERT_TRUE(goe->get_output_partial_shape(0).rank().is_dynamic());
-}
-
-TEST(type_prop, get_output_element_partial_rank_static_dynamic)
-{
- auto a = make_shared<op::Parameter>(
- element::i32, PartialShape{Dimension::dynamic(), 2, 3, Dimension::dynamic()});
- auto b = make_shared<op::Parameter>(
- element::i32, PartialShape{Dimension::dynamic(), 2, Dimension::dynamic(), 4});
- auto add = make_shared<op::Add>(a, b);
- auto goe = make_shared<op::GetOutputElement>(add, 0);
-
- ASSERT_EQ(goe->get_output_element_type(0), element::i32);
- ASSERT_TRUE(
- goe->get_output_partial_shape(0).same_scheme(PartialShape{Dimension::dynamic(), 2, 3, 4}));
-}
#include "ie_engines.hpp"
-#include "ngraph/op/get_output_element.hpp"
#include "ngraph/opsets/opset.hpp"
#include "ngraph/pass/manager.hpp"
#include "pass/opset1_upgrade.hpp"
{
if (ie_ops.find(node->get_type_info()) == ie_ops.end())
{
- if (node->get_type_info() == op::GetOutputElement::type_info)
- {
- // IE currently can handle GetOutputElement op;
- continue;
- }
- else
- {
- THROW_IE_EXCEPTION << "Unsupported operator detected in the graph: "
- << node->get_type_info().name;
- }
+ THROW_IE_EXCEPTION << "Unsupported operator detected in the graph: "
+ << node->get_type_info().name;
}
}