summaryrefslogtreecommitdiff
path: root/nn/runtime/test
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2020-05-16 00:02:50 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-05-16 00:02:50 +0000
commit494509a55d3de5627a32dcd69a631b941739ff21 (patch)
tree9bdfcbe626271ea74032b65ccfe9cf8d43fedd66 /nn/runtime/test
parent8a04de27835fab537106a0852daa730696555797 (diff)
parent23e00af42c1171286547e132ec3eaabb472fe9ea (diff)
downloadml-494509a55d3de5627a32dcd69a631b941739ff21.tar.gz
Merge "Fix incorrect (and inverted) comparison." into rvc-dev
Diffstat (limited to 'nn/runtime/test')
-rw-r--r--nn/runtime/test/TestValidateOperations.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/nn/runtime/test/TestValidateOperations.cpp b/nn/runtime/test/TestValidateOperations.cpp
index 4ac4f8d7d..01e4338d7 100644
--- a/nn/runtime/test/TestValidateOperations.cpp
+++ b/nn/runtime/test/TestValidateOperations.cpp
@@ -107,13 +107,17 @@ struct OperandTypeWithExtraParams {
}
}
- if (channelQuant.has_value() && channelQuant->scales) {
- return that.channelQuant->scales &&
- std::equal(channelQuant->scales, channelQuant->scales + channelQuant->scaleCount,
- that.channelQuant->scales);
- } else {
- return that.channelQuant->scales != nullptr;
+ if (channelQuant.has_value()) {
+ if (channelQuant->scales) {
+ return that.channelQuant->scales &&
+ std::equal(channelQuant->scales,
+ channelQuant->scales + channelQuant->scaleCount,
+ that.channelQuant->scales);
+ } else {
+ return that.channelQuant->scales == nullptr;
+ }
}
+ return true;
}
bool operator!=(const OperandTypeWithExtraParams& that) const { return !(*this == that); }