Unverified Commit caa84128 authored by Scott Cyphers's avatar Scott Cyphers Committed by GitHub

Add missing input (#3691) (#3699)

* Add missing input

* If builder does nothing, don't dive into the inputs

* Reverse test

* simplify, add test

* Add test
parent e555bc31
...@@ -330,7 +330,13 @@ shared_ptr<Node> Node::add_provenance_group_members_above(const OutputVector& ba ...@@ -330,7 +330,13 @@ shared_ptr<Node> Node::add_provenance_group_members_above(const OutputVector& ba
set<Node*> base_set; set<Node*> base_set;
for (auto& output : base) for (auto& output : base)
{ {
base_set.insert(output.get_node()); Node* node = output.get_node();
if (node == this)
{
// A builder did nothing
return shared_from_this();
}
base_set.insert(node);
} }
vector<Node*> todo; vector<Node*> todo;
for (auto value : input_values()) for (auto value : input_values())
......
...@@ -377,3 +377,24 @@ TEST(provenance, fused) ...@@ -377,3 +377,24 @@ TEST(provenance, fused)
} }
}); });
} }
TEST(provenance, empty_group)
{
auto p1 = make_shared<op::Parameter>(element::i32, PartialShape{2, 3, 4});
p1->add_provenance_tag("P1");
auto abs = make_shared<op::Abs>(p1);
// Make sure group is empty
abs->add_provenance_group_members_above({abs});
abs->add_provenance_tag("abs");
for (auto node : topological_sort(NodeVector{abs}))
{
if (node == p1)
{
EXPECT_EQ(node->get_provenance_tags(), (ProvSet{"P1"}));
}
else
{
EXPECT_EQ(node->get_provenance_tags(), (ProvSet{"abs"}));
}
}
}
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