diff options
author | Miao Wang <miaowang@google.com> | 2017-09-08 16:51:10 -0700 |
---|---|---|
committer | Miao Wang <miaowang@google.com> | 2017-09-09 11:43:05 -0700 |
commit | 55cef2193279a646292fdeb355399627dd8990c8 (patch) | |
tree | 14630088bc6b46e621cbccadb7ab99a327c4e056 /nn/runtime/test/TestTrivialModel.cpp | |
parent | fce2d202e5dd6f4b2193d84d8726ff4ba86e2fc8 (diff) | |
download | ml-55cef2193279a646292fdeb355399627dd8990c8.tar.gz |
Explicitly add "_2D" to applicable ops, and add fused activation
function enum.
- Add the fused activation enum to explicitly set the expectation that
only the included ones are supported for fused ops.
- Add "_2D" to CONV, DEPTHWISE_CONV, AVG_POOL, MAX_POOL, and L2_POOL,
since they are only supposed to do 2D computation.
- Updated the tests and the stack to plumbing the changes through.
Bug: 63905942
Test: mm
Test: NeuralNetworksTests pass for both CPU path and sample hidl driver.
Change-Id: I60aeabab1d193d26d938c0d1d3ffdd519740d222
Diffstat (limited to 'nn/runtime/test/TestTrivialModel.cpp')
-rw-r--r-- | nn/runtime/test/TestTrivialModel.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/nn/runtime/test/TestTrivialModel.cpp b/nn/runtime/test/TestTrivialModel.cpp index d062dc425..e05c7bca1 100644 --- a/nn/runtime/test/TestTrivialModel.cpp +++ b/nn/runtime/test/TestTrivialModel.cpp @@ -60,7 +60,7 @@ protected: void CreateAddTwoTensorModel(Model* model) { OperandType matrixType(Type::TENSOR_FLOAT32, {3, 4}); OperandType scalarType(Type::INT32, {}); - int32_t activation(0); + int32_t activation(ANEURALNETWORKS_FUSED_NONE); auto a = model->addOperand(&matrixType); auto b = model->addOperand(&matrixType); auto c = model->addOperand(&matrixType); @@ -76,7 +76,7 @@ void CreateAddTwoTensorModel(Model* model) { void CreateAddThreeTensorModel(Model* model, const Matrix3x4 bias) { OperandType matrixType(Type::TENSOR_FLOAT32, {3, 4}); OperandType scalarType(Type::INT32, {}); - int32_t activation(0); + int32_t activation(ANEURALNETWORKS_FUSED_NONE); auto a = model->addOperand(&matrixType); auto b = model->addOperand(&matrixType); auto c = model->addOperand(&matrixType); @@ -149,7 +149,7 @@ TEST_F(TrivialTest, AddThree) { TEST_F(TrivialTest, BroadcastAddTwo) { Model modelBroadcastAdd2; // activation: NONE. - int32_t activation_init[] = {0}; + int32_t activation_init[] = {ANEURALNETWORKS_FUSED_NONE}; OperandType scalarType(Type::INT32, {1}); auto activation = modelBroadcastAdd2.addOperand(&scalarType); modelBroadcastAdd2.setOperandValue(activation, activation_init, sizeof(int32_t) * 1); @@ -178,7 +178,7 @@ TEST_F(TrivialTest, BroadcastAddTwo) { TEST_F(TrivialTest, BroadcastMulTwo) { Model modelBroadcastMul2; // activation: NONE. - int32_t activation_init[] = {0}; + int32_t activation_init[] = {ANEURALNETWORKS_FUSED_NONE}; OperandType scalarType(Type::INT32, {1}); auto activation = modelBroadcastMul2.addOperand(&scalarType); modelBroadcastMul2.setOperandValue(activation, activation_init, sizeof(int32_t) * 1); |