From 245d64c60d0ea30f5080ff53225b5169927e24d6 Mon Sep 17 00:00:00 2001 From: Matthew Bentham Date: Mon, 2 Dec 2019 12:59:43 +0000 Subject: Work in progress of python bindings for Arm NN Not built or tested in any way Signed-off-by: Matthew Bentham Change-Id: Ie7f92b529aa5087130f0c5cc8c17db1581373236 --- .../src/pyarmnn/swig/modules/armnn_types_utils.i | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 python/pyarmnn/src/pyarmnn/swig/modules/armnn_types_utils.i (limited to 'python/pyarmnn/src/pyarmnn/swig/modules/armnn_types_utils.i') 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 + QuantizedType Quantize(float value, float scale, int32_t offset); + %template(Quantize_uint8_t) Quantize; + %template(Quantize_int16_t) Quantize; + %template(Quantize_int32_t) Quantize; + + template + float Dequantize(QuantizedType value, float scale, int32_t offset); + %template(Dequantize_uint8_t) Dequantize; + %template(Dequantize_int16_t) Dequantize; + %template(Dequantize_int32_t) Dequantize; +} -- cgit v1.2.1