aboutsummaryrefslogtreecommitdiff
path: root/python/pyarmnn/src/pyarmnn/swig/modules/armnn_types_utils.i
diff options
context:
space:
mode:
authorMatthew Bentham <Matthew.Bentham@arm.com>2019-12-02 12:59:43 +0000
committerMatthew Bentham <Matthew.Bentham@arm.com>2019-12-02 16:23:45 +0000
commit245d64c60d0ea30f5080ff53225b5169927e24d6 (patch)
treed623e46d7d5ddb34ef3bb84c45df3ada9209ce82 /python/pyarmnn/src/pyarmnn/swig/modules/armnn_types_utils.i
parent88d5f9f1615fa956464b8932b574d85c37cec937 (diff)
downloadarmnn-245d64c60d0ea30f5080ff53225b5169927e24d6.tar.gz
Work in progress of python bindings for Arm NNexperimental/pyarmnn
Not built or tested in any way Signed-off-by: Matthew Bentham <Matthew.Bentham@arm.com> Change-Id: Ie7f92b529aa5087130f0c5cc8c17db1581373236
Diffstat (limited to 'python/pyarmnn/src/pyarmnn/swig/modules/armnn_types_utils.i')
-rw-r--r--python/pyarmnn/src/pyarmnn/swig/modules/armnn_types_utils.i26
1 files changed, 26 insertions, 0 deletions
diff --git a/python/pyarmnn/src/pyarmnn/swig/modules/armnn_types_utils.i b/python/pyarmnn/src/pyarmnn/swig/modules/armnn_types_utils.i
new file mode 100644
index 0000000000..c11d9927c9
--- /dev/null
+++ b/python/pyarmnn/src/pyarmnn/swig/modules/armnn_types_utils.i
@@ -0,0 +1,26 @@
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+%{
+#include "armnn/TypesUtils.hpp"
+%}
+
+namespace armnn
+{
+ constexpr unsigned int GetDataTypeSize(DataType dataType);
+
+ constexpr const char* GetDataTypeName(DataType dataType);
+
+ template<typename QuantizedType>
+ QuantizedType Quantize(float value, float scale, int32_t offset);
+ %template(Quantize_uint8_t) Quantize<uint8_t>;
+ %template(Quantize_int16_t) Quantize<int16_t>;
+ %template(Quantize_int32_t) Quantize<int32_t>;
+
+ template <typename QuantizedType>
+ float Dequantize(QuantizedType value, float scale, int32_t offset);
+ %template(Dequantize_uint8_t) Dequantize<uint8_t>;
+ %template(Dequantize_int16_t) Dequantize<int16_t>;
+ %template(Dequantize_int32_t) Dequantize<int32_t>;
+}