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>
diff --git a/src/armnnSerializer/SerializerUtils.cpp b/src/armnnSerializer/SerializerUtils.cpp
index df1ef28..02a5ed3 100644
--- a/src/armnnSerializer/SerializerUtils.cpp
+++ b/src/armnnSerializer/SerializerUtils.cpp
@@ -79,6 +79,25 @@
}
}
+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)