summaryrefslogtreecommitdiff
path: root/nn/common/operations/Elu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'nn/common/operations/Elu.cpp')
-rw-r--r--nn/common/operations/Elu.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/nn/common/operations/Elu.cpp b/nn/common/operations/Elu.cpp
index 0c72cb383..105ef01cf 100644
--- a/nn/common/operations/Elu.cpp
+++ b/nn/common/operations/Elu.cpp
@@ -56,15 +56,17 @@ bool validate(const IOperationValidationContext* context) {
NN_RET_CHECK_EQ(context->getNumInputs(), kNumInputs);
NN_RET_CHECK_EQ(context->getNumOutputs(), kNumOutputs);
auto inputType = context->getInputType(kInputTensor);
+ auto minSupportedVersion = Version::ANDROID_OC_MR1;
if (inputType == OperandType::TENSOR_FLOAT16 || inputType == OperandType::TENSOR_FLOAT32) {
- NN_RET_CHECK(validateVersion(context, Version::ANDROID_R));
+ minSupportedVersion = Version::ANDROID_R;
} else {
NN_RET_CHECK_FAIL() << "Unsupported tensor type for operation ELU";
}
auto scalarType =
inputType == OperandType::TENSOR_FLOAT16 ? OperandType::FLOAT16 : OperandType::FLOAT32;
- return validateInputTypes(context, {inputType, scalarType}) &&
- validateOutputTypes(context, {inputType});
+ NN_RET_CHECK(validateInputTypes(context, {inputType, scalarType}));
+ NN_RET_CHECK(validateOutputTypes(context, {inputType}));
+ return validateVersion(context, minSupportedVersion);
}
bool prepare(IOperationExecutionContext* context) {