Commit 32396d8f authored by Paul's avatar Paul
Browse files

Formatting

parent ed49d0c4
...@@ -18,11 +18,13 @@ struct find_add_lit_broadcast ...@@ -18,11 +18,13 @@ struct find_add_lit_broadcast
} }
auto add_lit_broadcast(std::string x, std::string y) const auto add_lit_broadcast(std::string x, std::string y) const
{ {
return match::name("add")(match::either_arg(0, 1)(lit_broadcast().bind(x), not_lit_broadcast().bind(y))); return match::name("add")(
match::either_arg(0, 1)(lit_broadcast().bind(x), not_lit_broadcast().bind(y)));
} }
auto matcher() const auto matcher() const
{ {
return match::name("add")(match::args(add_lit_broadcast("a", "x"), add_lit_broadcast("b", "y"))); return match::name("add")(
match::args(add_lit_broadcast("a", "x"), add_lit_broadcast("b", "y")));
} }
void apply(program& p, match::matcher_result r) const void apply(program& p, match::matcher_result r) const
...@@ -42,7 +44,8 @@ struct find_add_lit_broadcast ...@@ -42,7 +44,8 @@ struct find_add_lit_broadcast
if(a_ins->inputs().at(0)->get_shape() != b_ins->inputs().at(0)->get_shape()) if(a_ins->inputs().at(0)->get_shape() != b_ins->inputs().at(0)->get_shape())
return; return;
auto op = a_ins->get_operator(); auto op = a_ins->get_operator();
auto presum = p.insert_instruction(ins, op::add{}, a_ins->inputs().at(0), b_ins->inputs().at(0)); auto presum =
p.insert_instruction(ins, op::add{}, a_ins->inputs().at(0), b_ins->inputs().at(0));
sumab = p.insert_instruction(ins, op, presum); sumab = p.insert_instruction(ins, op, presum);
} }
else else
......
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