Commit 692101a7 authored by Nick Korovaiko's avatar Nick Korovaiko Committed by Adam Procter

Replace Check (#1097)

parent e682af65
......@@ -37,6 +37,16 @@ void Input::replace_output(Output& new_output)
new_output.add_input(this);
m_output = &new_output;
m_src_node = std::shared_ptr<Node>(new_output.get_node());
static const auto nerc = std::getenv("NGRAPH_ENABLE_REPLACE_CHECK");
if (nerc)
{
//the result of copy_with_new_args will be thrown away or
//an exception will be thrown by `m_node`'s class c-tor
//if a new input violates one of the type checks in the c-tor.
(this->m_node->copy_with_new_args(this->m_node->get_arguments()));
}
}
void Input::replace_output(std::shared_ptr<Node> node, size_t i)
......
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