Commit 5f2767aa authored by Paul Fultz II's avatar Paul Fultz II Committed by mvermeulen
Browse files

Add more shape operators that can be nops (#390)

* Add more shape operators that can be nops

* Dont remove pooling
parent 193a3b7c
...@@ -17,6 +17,7 @@ const auto& reshaper_names() ...@@ -17,6 +17,7 @@ const auto& reshaper_names()
{ {
// clang-format off // clang-format off
static const std::unordered_set<std::string> names = { static const std::unordered_set<std::string> names = {
"flatten",
"reshape", "reshape",
"contiguous", "contiguous",
"squeeze", "squeeze",
...@@ -98,8 +99,13 @@ struct find_nop_reshapes ...@@ -98,8 +99,13 @@ struct find_nop_reshapes
auto matcher() const auto matcher() const
{ {
auto reshapes = reshaper_names(); auto reshapes = reshaper_names();
reshapes.insert("transpose"); reshapes.insert("as_shape");
reshapes.insert("broadcast");
reshapes.insert("concat");
reshapes.insert("multibroadcast");
reshapes.insert("pad");
reshapes.insert("slice"); reshapes.insert("slice");
reshapes.insert("transpose");
return match::name(reshapes)(match::same_shape(match::arg(0))); return match::name(reshapes)(match::same_shape(match::arg(0)));
} }
......
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