Commit dd465fab authored by Paul's avatar Paul
Browse files

Formatting

parent 203a4c4c
...@@ -65,15 +65,20 @@ struct instruction ...@@ -65,15 +65,20 @@ struct instruction
bool valid(instruction_ref start) const bool valid(instruction_ref start) const
{ {
std::vector<shape> shapes(arguments.size()); std::vector<shape> shapes(arguments.size());
std::transform(arguments.begin(), arguments.end(), shapes.begin(), [](instruction_ref ins) { return ins->result; }); std::transform(arguments.begin(), arguments.end(), shapes.begin(), [](instruction_ref ins) {
return ins->result;
});
shape computed; shape computed;
try try
{ {
computed = op.compute_shape(shapes); computed = op.compute_shape(shapes);
} }
catch(migraph::exception&) { return false; } catch(migraph::exception&)
{
return false;
}
return result == computed && return result == computed &&
std::all_of(output.begin(), std::all_of(output.begin(),
output.end(), output.end(),
[&](instruction_ref i) { [&](instruction_ref i) {
return std::find(i->arguments.begin(), i->arguments.end(), *this) != return std::find(i->arguments.begin(), i->arguments.end(), *this) !=
...@@ -81,7 +86,8 @@ struct instruction ...@@ -81,7 +86,8 @@ struct instruction
}) && }) &&
std::all_of(arguments.begin(), arguments.end(), [&](instruction_ref i) { std::all_of(arguments.begin(), arguments.end(), [&](instruction_ref i) {
auto self = std::find(i->output.begin(), i->output.end(), *this); auto self = std::find(i->output.begin(), i->output.end(), *this);
return self != i->output.end() && std::distance(start, i) < std::distance(start, *self); return self != i->output.end() &&
std::distance(start, i) < std::distance(start, *self);
}); });
} }
......
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