diff --git a/ngraph/core/include/openvino/op/result.hpp b/ngraph/core/include/openvino/op/result.hpp index eecd665bffe..dfccdd82461 100644 --- a/ngraph/core/include/openvino/op/result.hpp +++ b/ngraph/core/include/openvino/op/result.hpp @@ -19,25 +19,26 @@ public: /// \brief Allows a value to be used as a function result. /// /// \param arg Node that produces the input tensor. - Result(const Output& arg, bool needs_default_layout = false); + Result(const Output& arg); + + OPENVINO_DEPRECATED("This constructor is redundant, use Result(const Output& arg) instead.") + Result(const Output& arg, bool); bool visit_attributes(AttributeVisitor& visitor) override; void validate_and_infer_types() override; std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - void set_needs_default_layout(bool val) { - m_needs_default_layout = val; - } + OPENVINO_DEPRECATED("This method provides no usage and has no replacement.") + void set_needs_default_layout(bool) {} + OPENVINO_DEPRECATED("This method provides no usage and has no replacement.") bool needs_default_layout() const { - return m_needs_default_layout; + return false; } + bool evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const override; bool has_evaluate() const override; bool constant_fold(OutputVector& output_values, const OutputVector& inputs_values) override; - -private: - bool m_needs_default_layout{false}; }; } // namespace v0 } // namespace op diff --git a/ngraph/core/src/op/result.cpp b/ngraph/core/src/op/result.cpp index 70cc119d9d4..2d70921d790 100644 --- a/ngraph/core/src/op/result.cpp +++ b/ngraph/core/src/op/result.cpp @@ -17,9 +17,11 @@ using namespace ngraph; BWDCMP_RTTI_DEFINITION(op::v0::Result); -op::Result::Result(const Output& arg, bool needs_default_layout) - : Op({arg}), - m_needs_default_layout(needs_default_layout) { +op::Result::Result(const Output& arg) : Op({arg}) { + constructor_validate_and_infer_types(); +} + +op::Result::Result(const Output& arg, bool) : Op({arg}) { constructor_validate_and_infer_types(); } @@ -42,7 +44,7 @@ shared_ptr op::Result::clone_with_new_inputs(const OutputVector& new_args) NGRAPH_OP_SCOPE(v0_Result_clone_with_new_inputs); check_new_args_count(this, new_args); - auto res = make_shared(new_args.at(0), m_needs_default_layout); + auto res = make_shared(new_args.at(0)); return std::move(res); } diff --git a/ngraph/test/build_graph.cpp b/ngraph/test/build_graph.cpp index a32fd79c529..ea7221d36c8 100644 --- a/ngraph/test/build_graph.cpp +++ b/ngraph/test/build_graph.cpp @@ -288,7 +288,7 @@ TEST(build_graph, build_graph_with_add_result) { auto res = make_shared(pattern); const auto axis = op::Constant::create(element::i64, Shape{}, {1}); auto crop = make_shared(pattern, axis, 3); - auto res2 = make_shared(crop, "v0"); + auto res2 = make_shared(crop); auto f = make_shared(ResultVector({res}), ParameterVector{arg}); @@ -314,7 +314,7 @@ TEST(build_graph, build_graph_with_remove_result) { auto res = make_shared(pattern); const auto axis = op::Constant::create(element::i64, Shape{}, {1}); auto crop = make_shared(pattern, axis, 3); - auto res2 = make_shared(crop, "v0"); + auto res2 = make_shared(crop); auto f = make_shared(ResultVector({res, res2}), ParameterVector{arg}); @@ -340,7 +340,7 @@ TEST(build_graph, build_graph_with_add_parameter) { auto res = make_shared(pattern); const auto axis = op::Constant::create(element::i64, Shape{}, {1}); auto crop = make_shared(pattern, axis, 3); - auto res2 = make_shared(crop, "v0"); + auto res2 = make_shared(crop); auto f = make_shared(ResultVector({res, res2}), ParameterVector{arg}); @@ -369,7 +369,7 @@ TEST(build_graph, build_graph_with_remove_parameter) { auto res = make_shared(pattern); const auto axis = op::Constant::create(element::i64, Shape{}, {1}); auto crop = make_shared(pattern, axis, 3); - auto res2 = make_shared(crop, "v0"); + auto res2 = make_shared(crop); auto f = make_shared(ResultVector({res, res2}), ParameterVector{arg, arg2}); @@ -398,7 +398,7 @@ TEST(build_graph, build_graph_with_remove_parameter_indexing) { auto res = make_shared(pattern); const auto axis = op::Constant::create(element::i64, Shape{}, {1}); auto crop = make_shared(pattern, axis, 3); - auto res2 = make_shared(crop, "v0"); + auto res2 = make_shared(crop); auto f = make_shared(ResultVector({res, res2}), ParameterVector{arg2, arg}); @@ -449,7 +449,7 @@ TEST(build_graph, build_graph_parameters_variables_autodetection) { auto res = make_shared(pattern); const auto axis = Constant::create(element::i64, Shape{}, {1}); auto crop = make_shared(pattern, axis, 3); - auto res2 = make_shared(crop, "v0"); + auto res2 = make_shared(crop); auto f = make_shared(OutputVector{res, res2}, SinkVector{assign}); @@ -477,7 +477,7 @@ TEST(build_graph, build_graph_variables_ctors) { auto res = make_shared(pattern); const auto axis = Constant::create(element::i64, Shape{}, {1}); auto crop = make_shared(pattern, axis, 3); - auto res2 = make_shared(crop, "v0"); + auto res2 = make_shared(crop); { auto f = make_shared(OutputVector{res, res2}, @@ -524,10 +524,10 @@ TEST(build_graph, build_graph_unregistred_variables) { auto res = make_shared(pattern); const auto axis = Constant::create(element::i64, Shape{}, {1}); auto crop = make_shared(pattern, axis, 3); - auto res2 = make_shared(crop, "v0"); + auto res2 = make_shared(crop); EXPECT_ANY_THROW(make_shared(OutputVector{res, res2}, SinkVector{assign, assign_2}, ParameterVector{arg, arg2}, VariableVector{variable})); -} \ No newline at end of file +}