Commit c6d84856 authored by Paul's avatar Paul
Browse files

Dont always insert multi broadcast when its not necessary

parent 803eb3ce
...@@ -113,7 +113,7 @@ struct onnx_parser ...@@ -113,7 +113,7 @@ struct onnx_parser
} }
return prog.add_instruction(x, args); return prog.add_instruction(x, args);
} }
else else if(args[0]->get_shape() != args[1]->get_shape())
{ {
// Example: // Example:
// s0 = (3,2,4,5) and s1 = (2,1,1) // s0 = (3,2,4,5) and s1 = (2,1,1)
...@@ -148,6 +148,9 @@ struct onnx_parser ...@@ -148,6 +148,9 @@ struct onnx_parser
auto l0 = prog.add_instruction(op::multibroadcast{output_lens}, args[0]); auto l0 = prog.add_instruction(op::multibroadcast{output_lens}, args[0]);
auto l1 = prog.add_instruction(op::multibroadcast{output_lens}, args[1]); auto l1 = prog.add_instruction(op::multibroadcast{output_lens}, args[1]);
return prog.add_instruction(x, l0, l1); return prog.add_instruction(x, l0, l1);
} else
{
return prog.add_instruction(x, args);
} }
}); });
} }
......
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