提交 410a5356 编写于 作者: Q qingqing01 提交者: gongweibao

Fix infer_shape in compling for elementwise_op (#22291) (#22353)

上级 88d87a5f
......@@ -143,10 +143,11 @@ inline void GetBroadcastDimsArrays(const framework::DDim &x_dims,
"the shape of Y = [%s]. Received [%d] in X is not equal to "
"[%d] in Y",
x_dims, y_dims, x_dims_array[i], y_dims_array[i]);
if (x_dims_array[i] == -1 || y_dims_array[i] == -1) {
out_dims_array[i] = -1;
} else {
if ((x_dims_array[i] > 1 || y_dims_array[i] > 1) ||
(x_dims_array[i] == 1 && y_dims_array[i] == 1)) {
out_dims_array[i] = std::max(x_dims_array[i], y_dims_array[i]);
} else {
out_dims_array[i] = -1;
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册