We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 756228c commit 1313dabCopy full SHA for 1313dab
1 file changed
src/webnn/native/ops/Binary.cpp
@@ -54,11 +54,12 @@ namespace webnn::native::op {
54
}
55
outputShape = {1};
56
57
- if (rankA == 2 && rankB == 1) {
58
- if (inputShapeA[1] != inputShapeB[0]) {
+ if (rankA >= 2 && rankB == 1) {
+ if (inputShapeA[rankA - 1] != inputShapeB[0]) {
59
return DAWN_VALIDATION_ERROR("The input shapes are incompatible.");
60
61
- outputShape = {inputShapeA[0], 1};
+ outputShape = std::move(inputShapeA);
62
+ outputShape[rankA - 1] = 1;
63
64
if (rankA == 1 && rankB == 2) {
65
if (inputShapeA[0] != inputShapeB[0]) {
0 commit comments