Commit 4763a55e authored by Nick Korovaiko's avatar Nick Korovaiko Committed by Jayaram Bobba

Forbid replacing multi-output nodes directly until we have a clear valid use case in mind (#745)

* making replace_node more robust

* fix error msg

* tweak err msg
parent d48301de
......@@ -123,6 +123,13 @@ void ngraph::replace_node(std::shared_ptr<Node> target, std::shared_ptr<Node> re
throw ngraph_error("Result nodes cannot be replaced.");
}
if (target->get_outputs().size() > 1)
{
throw ngraph_error(
"Multi-output nodes should not be replaced directly. The corresponding "
"GetOutputElements should be replaced instead");
}
// Fix input/output descriptors
assert(target->get_outputs().size() == replacement->get_outputs().size());
......
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