Commit 47ca6522 authored by Paul's avatar Paul
Browse files

Reduce nesting

parent ac031de5
......@@ -33,19 +33,17 @@ void propagate_constant::apply(program& p) const
ins->outputs().end());
for(auto child : children)
{
if(not skip_propogate(child))
if (skip_propogate(child))
{
auto r = child->eval();
if(not r.empty())
{
assert(r.get_shape() == child->get_shape());
auto l = p.add_literal(r.get_shape(), r.data());
self(p.replace_instruction(child, l));
}
self(child);
continue;
}
else
auto r = child->eval();
if(not r.empty())
{
self(child);
assert(r.get_shape() == child->get_shape());
auto l = p.add_literal(r.get_shape(), r.data());
self(p.replace_instruction(child, l));
}
}
})(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