aboutsummaryrefslogtreecommitdiff
path: root/src/armnnSerializer/SerializerUtils.cpp
diff options
context:
space:
mode:
authorjosh minor <josh.minor@arm.com>2020-01-06 16:40:46 -0600
committerDerek Lamberti <derek.lamberti@arm.com>2020-01-23 14:29:14 +0000
commit4a3c61091037e7e86e8b03bb060d8c1ab82731a9 (patch)
tree928644023400ad5ac0c26b33dfff2f975567d6e8 /src/armnnSerializer/SerializerUtils.cpp
parent190a39a4a9598e42b636ae4ab843761884148160 (diff)
downloadarmnn-4a3c61091037e7e86e8b03bb060d8c1ab82731a9.tar.gz
IVGCVSW-4259 Add frontend and reference workload for UnaryOperationLayer
* Added new layer named ElementwiseUnary * Deprecated existing Abs/Rsqrt layer functions * Updated existing Abs/Rsqrt test infrastructure to use new layer * Added boilerplate for new Exp,Neg,Sqrt elemwise op layers * AbsQuantize test removed pending future commit * Serialization support added !android-nn-driver:2550 Change-Id: Ic595c645925e17b45db568187fd05646daf2e87f Signed-off-by: josh minor <josh.minor@arm.com>
Diffstat (limited to 'src/armnnSerializer/SerializerUtils.cpp')
-rw-r--r--src/armnnSerializer/SerializerUtils.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/armnnSerializer/SerializerUtils.cpp b/src/armnnSerializer/SerializerUtils.cpp
index df1ef285de..02a5ed3872 100644
--- a/src/armnnSerializer/SerializerUtils.cpp
+++ b/src/armnnSerializer/SerializerUtils.cpp
@@ -79,6 +79,25 @@ armnnSerializer::DataLayout GetFlatBufferDataLayout(armnn::DataLayout dataLayout
}
}
+armnnSerializer::UnaryOperation GetFlatBufferUnaryOperation(armnn::UnaryOperation comparisonOperation)
+{
+ switch (comparisonOperation)
+ {
+ case armnn::UnaryOperation::Abs:
+ return armnnSerializer::UnaryOperation::UnaryOperation_Abs;
+ case armnn::UnaryOperation::Rsqrt:
+ return armnnSerializer::UnaryOperation::UnaryOperation_Rsqrt;
+ case armnn::UnaryOperation::Sqrt:
+ return armnnSerializer::UnaryOperation::UnaryOperation_Sqrt;
+ case armnn::UnaryOperation::Exp:
+ return armnnSerializer::UnaryOperation::UnaryOperation_Exp;
+ case armnn::UnaryOperation::Neg:
+ return armnnSerializer::UnaryOperation::UnaryOperation_Neg;
+ default:
+ throw armnn::InvalidArgumentException("Unary operation unknown");
+ }
+}
+
armnnSerializer::PoolingAlgorithm GetFlatBufferPoolingAlgorithm(armnn::PoolingAlgorithm poolingAlgorithm)
{
switch (poolingAlgorithm)