summaryrefslogtreecommitdiff
path: root/nn/runtime/test
diff options
context:
space:
mode:
authorDavid Gross <dgross@google.com>2020-04-09 22:50:33 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-04-09 22:50:33 +0000
commitdc48cbaae17c0cfb93677c020075b0a1fc8534a0 (patch)
treeac6873b45b7954876d6392da8c6d28442752d29b /nn/runtime/test
parent4467d6890c57c3c10102283a11036a2f29bcce18 (diff)
parentb5431191e35e1ea5f30ff007902fc7faaaea6a99 (diff)
downloadml-dc48cbaae17c0cfb93677c020075b0a1fc8534a0.tar.gz
Merge "Add some V1_3 operations to Seed/RandomPartitioningTest.*" into rvc-dev
Diffstat (limited to 'nn/runtime/test')
-rw-r--r--nn/runtime/test/TestPartitioningRandom.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/nn/runtime/test/TestPartitioningRandom.cpp b/nn/runtime/test/TestPartitioningRandom.cpp
index 138f3592c..892cfd405 100644
--- a/nn/runtime/test/TestPartitioningRandom.cpp
+++ b/nn/runtime/test/TestPartitioningRandom.cpp
@@ -376,6 +376,20 @@ class RandomPartitioningTest : public ::testing::TestWithParam<unsigned> {
static const OperationPattern kOperationPatterns[];
// See OperationPattern::mMakeSpecialInput. This function is used to
+ // manufacture an ELU input operand that doesn't fit the general operand
+ // pattern known to the graph generator infrastructure.
+ int makeEluSpecialInput([[maybe_unused]] unsigned problemSize, TestModel* model,
+ unsigned inputIndex) {
+ if (inputIndex != 1) {
+ return -1;
+ }
+
+ // input operand 1 is alpha, a scalar
+ const WrapperOperandType alphaType(WrapperType::FLOAT32, {});
+ return int(model->addConstantOperand(&alphaType, 1.0f));
+ }
+
+ // See OperationPattern::mMakeSpecialInput. This function is used to
// manufacture an RNN input operand that doesn't fit the general operand
// pattern known to the graph generator infrastructure.
int makeRnnSpecialInput(unsigned problemSize, TestModel* model, unsigned inputIndex) {
@@ -462,6 +476,10 @@ const RandomPartitioningTest::OperationPattern RandomPartitioningTest::kOperatio
{HalVersion::V1_2, ANEURALNETWORKS_MAXIMUM, 2, 1, -1, nullptr},
{HalVersion::V1_2, ANEURALNETWORKS_NEG, 1, 1, -1, nullptr},
{HalVersion::V1_2, ANEURALNETWORKS_SIN, 1, 1, -1, nullptr},
+
+ {HalVersion::V1_3, ANEURALNETWORKS_ELU, 2, 1, -1,
+ &RandomPartitioningTest::makeEluSpecialInput},
+ {HalVersion::V1_3, ANEURALNETWORKS_HARD_SWISH, 1, 1, -1, nullptr},
};
HalVersion RandomPartitioningTest::getMinHalVersion(ANeuralNetworksOperationType type) {