Unverified Commit d309e02f authored by Paul Fultz II's avatar Paul Fultz II Committed by GitHub
Browse files

Only fuse add with layernorm when its used once (#1529)

This prevents multiple adds.
parent 8b651eee
...@@ -100,7 +100,8 @@ struct find_add_layernorm ...@@ -100,7 +100,8 @@ struct find_add_layernorm
{ {
auto matcher() const auto matcher() const
{ {
return match::layernorm()(match::var("x")(match::name("add").bind("add"))); return match::layernorm()(
match::var("x")(match::name("add")(match::used_once()).bind("add")));
} }
void apply(module& m, const match::matcher_result& r) const void apply(module& m, const match::matcher_result& r) const
......
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