Fix infer_shape in compling for elementwise_op (#22291)

revert-22710-feature/integrated_ps_api
qingqing01 5 years ago committed by gongweibao
parent b7cac50b64
commit 2d20869c94

@ -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;
}
}
}

Loading…
Cancel
Save