Commit 590cc055 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

fixed a bug in the cpu implementation of the binary operation

parent 5f1994cb
...@@ -28,8 +28,10 @@ struct binary : op_name<Derived> ...@@ -28,8 +28,10 @@ struct binary : op_name<Derived>
argument compute(const shape& output_shape, std::vector<argument> args) const argument compute(const shape& output_shape, std::vector<argument> args) const
{ {
argument result{output_shape}; argument result{output_shape};
auto s1 = args[0].get_shape();
auto s2 = args[1].get_shape();
visit_all(result, args[0], args[1])([&](auto output, auto input1, auto input2) { visit_all(result, args[0], args[1])([&](auto output, auto input1, auto input2) {
if(input1.get_shape().packed() and input2.get_shape().packed()) if(s1 == s2 and input1.get_shape().packed() and input2.get_shape().packed())
{ {
std::transform(input1.begin(), std::transform(input1.begin(),
input1.end(), input1.end(),
......
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