Unverified Commit 27ce7250 authored by Scott Cyphers's avatar Scott Cyphers Committed by GitHub

Don't add nodes we've already seen to the to-do list (#3807)

parent 1e2a3f34
......@@ -389,7 +389,7 @@ shared_ptr<Node> Node::add_provenance_group_members_above(const OutputVector& ba
add_provenance_group_member(node->shared_from_this());
for (auto value : node->input_values())
{
if (0 == node->m_provenance_group.count(value.get_node_shared_ptr()))
if (m_provenance_group.count(value.get_node_shared_ptr()) == 0)
{
todo.push_back(value.get_node());
}
......
......@@ -441,3 +441,34 @@ TEST(provenance, empty_group)
}
}
}
TEST(provenance, scaled_quantize_concat_unsigned)
{
ngraph::Shape shape_a{2, 2};
auto A = make_shared<ngraph::op::Parameter>(ngraph::element::u8, shape_a);
auto An = make_shared<ngraph::op::Parameter>(ngraph::element::f32, ngraph::Shape{1});
auto Ax = make_shared<ngraph::op::Parameter>(ngraph::element::f32, ngraph::Shape{1});
A->add_provenance_tag("in0");
An->add_provenance_tag("in1");
Ax->add_provenance_tag("in2");
ngraph::Shape shape_r{2, 2};
auto QConcat = ngraph::builder::QuantizedConcatBuilder(
ngraph::NodeVector{A}, 0, ngraph::NodeVector{An}, ngraph::NodeVector{Ax});
auto f = make_shared<ngraph::Function>(ngraph::NodeVector{QConcat},
ngraph::ParameterVector{A, An, Ax});
QConcat->add_provenance_tag("hello");
auto check_if_result = [](shared_ptr<Node> n) {
// Pointer will cast to nullptr if this node is not a Result
auto ng_node = dynamic_pointer_cast<op::Result>(n);
bool is_result = (ng_node != nullptr);
return is_result;
};
for (auto n : f->get_ordered_ops())
{
if (!check_if_result(n))
{
ASSERT_EQ(n->get_provenance_tags().size(), 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