"vscode:/vscode.git/clone" did not exist on "6e967f507dc429b1456e3deb92233c7f2c08c0dd"
Commit 52f44f87 authored by Paul's avatar Paul
Browse files

Formatting

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