diff options
author | Lev Proleev <levp@google.com> | 2019-12-16 15:49:17 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-12-16 15:49:17 +0000 |
commit | c8c30c449639c7de3cc8a213432ce5cc20b9ad86 (patch) | |
tree | 216b704f370eda93ab5359dc83670066b81295cc /nn/runtime/test/TestValidateOperations.cpp | |
parent | 492b76853f11c8cf239c47049ae158d46533f13d (diff) | |
parent | 70c2f32e9e5200020da74b2e5afd2196954535f4 (diff) | |
download | ml-c8c30c449639c7de3cc8a213432ce5cc20b9ad86.tar.gz |
Merge "Add TENSOR_QUANT8_ASYMM_SIGNED support for generate proposals ops"
Diffstat (limited to 'nn/runtime/test/TestValidateOperations.cpp')
-rw-r--r-- | nn/runtime/test/TestValidateOperations.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/nn/runtime/test/TestValidateOperations.cpp b/nn/runtime/test/TestValidateOperations.cpp index 5497dffda..0a259a2b4 100644 --- a/nn/runtime/test/TestValidateOperations.cpp +++ b/nn/runtime/test/TestValidateOperations.cpp @@ -196,6 +196,13 @@ class OperationTestBase { operandTypesToSkip.insert(ANEURALNETWORKS_TENSOR_QUANT8_SYMM); operandTypesToSkip.insert(ANEURALNETWORKS_TENSOR_QUANT8_SYMM_PER_CHANNEL); } + // AXIS_ALIGNED_BBOX_TRANSFORM's second input cab be either QUANT8_ASYMM or + // QUANT8_ASYMM_SIGNED + if (mOpCode == ANEURALNETWORKS_AXIS_ALIGNED_BBOX_TRANSFORM && i == 1) { + operandTypesToSkip.insert(ANEURALNETWORKS_TENSOR_QUANT8_ASYMM); + operandTypesToSkip.insert(ANEURALNETWORKS_TENSOR_QUANT8_ASYMM_SIGNED); + } + for (int32_t newOperandCode : kAvailableOperandCodes) { if (newOperandCode == originalOperandCode || operandTypesToSkip.find(newOperandCode) != operandTypesToSkip.end()) { @@ -2863,6 +2870,11 @@ TEST(OperationValidationTest, AXIS_ALIGNED_BBOX_TRANSFORM_quant) { ANEURALNETWORKS_TENSOR_QUANT8_ASYMM); } +TEST(OperationValidationTest, AXIS_ALIGNED_BBOX_TRANSFORM_quant_signed) { + axisAlignedBBoxTransformOpTest(ANEURALNETWORKS_TENSOR_QUANT16_ASYMM, + ANEURALNETWORKS_TENSOR_QUANT8_ASYMM_SIGNED); +} + void sliceTest(int32_t operandCode) { uint32_t inputDim[] = {3, 3, 3}; uint32_t startDim[] = {3}; @@ -3093,6 +3105,11 @@ TEST(OperationValidationTest, BOX_WITH_NMS_LIMIT_quant) { ANEURALNETWORKS_FLOAT32); } +TEST(OperationValidationTest, BOX_WITH_NMS_LIMIT_quant_signed) { + boxWithNmsLimitOpTest(ANEURALNETWORKS_TENSOR_QUANT8_ASYMM_SIGNED, + ANEURALNETWORKS_TENSOR_QUANT16_ASYMM, ANEURALNETWORKS_FLOAT32); +} + void castOpTest(int32_t inputOperandCode, int32_t outputOperandCode) { SCOPED_TRACE(testing::Message() << "inputType: " << inputOperandCode << ", outputType: " << outputOperandCode); @@ -3467,6 +3484,13 @@ TEST(OperationValidationTest, GENERATE_PROPOSALS_quant) { ANEURALNETWORKS_TENSOR_QUANT16_ASYMM, ANEURALNETWORKS_FLOAT32); } +TEST(OperationValidationTest, GENERATE_PROPOSALS_quant_signed) { + generateProposalsOpTest(ANEURALNETWORKS_TENSOR_QUANT8_ASYMM_SIGNED, + ANEURALNETWORKS_TENSOR_QUANT8_ASYMM_SIGNED, + ANEURALNETWORKS_TENSOR_QUANT16_SYMM, + ANEURALNETWORKS_TENSOR_QUANT16_ASYMM, ANEURALNETWORKS_FLOAT32); +} + void resizeNearestNeighborTest(int32_t inputCode, int32_t scalarCode) { uint32_t inputDim[] = {1, 2, 2, 1}, outputDim[] = {1, 1, 1, 1}; OperationTestBase resizeImageOpTest(ANEURALNETWORKS_RESIZE_NEAREST_NEIGHBOR, |