summaryrefslogtreecommitdiff
path: root/nn/common/operations/Broadcast.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'nn/common/operations/Broadcast.cpp')
-rw-r--r--nn/common/operations/Broadcast.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/nn/common/operations/Broadcast.cpp b/nn/common/operations/Broadcast.cpp
index e19ce742e..17094afa3 100644
--- a/nn/common/operations/Broadcast.cpp
+++ b/nn/common/operations/Broadcast.cpp
@@ -466,6 +466,12 @@ bool validate(OperationType opType, const IOperationValidationContext* context)
} else {
NN_RET_CHECK_FAIL() << "Unsupported tensor type for operation " << getOperationName(opType);
}
+ const Shape& input1 = context->getInputShape(kInputTensor1);
+ const Shape& input2 = context->getInputShape(kInputTensor2);
+ if (hasKnownRank(input1) && hasKnownRank(input2)) {
+ NN_RET_CHECK_LE(getNumberOfDimensions(input1), 4);
+ NN_RET_CHECK_LE(getNumberOfDimensions(input2), 4);
+ }
return validateInputTypes(context, {inputType, inputType, OperandType::INT32}) &&
validateOutputTypes(context, {inputType});
}