Commit 52f44f87 authored by Paul's avatar Paul
Browse files

Formatting

parent d2a38cd4
......@@ -10,12 +10,10 @@ namespace migraph {
bool is_reshaper(const std::string& name)
{
static const std::unordered_set<std::string> names = {
"reshape",
static const std::unordered_set<std::string> names = {"reshape",
"transpose",
// "broadcast",
"contiguous"
};
"contiguous"};
return contains(names, name);
}
......@@ -39,17 +37,19 @@ void simplify_reshapes::apply(program& p) const
}
std::pair<instruction_ref, instruction_ref> r{p.end(), p.end()};
for(auto start:iterator_for(reshapes))
for(auto start : iterator_for(reshapes))
{
auto last = std::find_if(reshapes.rbegin(), reshapes.rend(), [&](auto&& i) {
return i->result == (*start)->result and i != (*start);
});
if (last != reshapes.rend()) {
if(last != reshapes.rend())
{
r = std::make_pair(*start, *last);
break;
}
}
if(r.first != r.second) {
if(r.first != r.second)
{
p.replace_instruction(r.first, r.second);
}
}
......
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