From d15866c06c88b9ec2e6313cc19f89ea65b528f8a Mon Sep 17 00:00:00 2001 From: Patrik Gustavsson Date: Tue, 10 Aug 2021 13:56:34 +0200 Subject: MLBEDSW-4838 TOSA const data input changes Adoptions related to changes for constant data in TOSA. Constant data not longer stored in .npy files, but within the .tosa-file. Signed-off-by: Patrik Gustavsson Change-Id: Ia1148c2f8b783b3926a1ee0b9ad0a3aeff9d22f5 --- ethosu/vela/tosa_mapping.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ethosu/vela/tosa_mapping.py') diff --git a/ethosu/vela/tosa_mapping.py b/ethosu/vela/tosa_mapping.py index 312ac92e..75ca43ef 100644 --- a/ethosu/vela/tosa_mapping.py +++ b/ethosu/vela/tosa_mapping.py @@ -17,6 +17,8 @@ # TOSA mapping functions used by reader. # Contains a mapping from the various TOSA enums and options structs, generated by the FlatBuffer code # generator, to Vela's internal format. +import numpy as np + from .data_type import DataType from .operation import Op from .operation import TensorIndices @@ -54,6 +56,15 @@ datatype_map = { DType.FLOAT: DataType.float32, } +datatype_map_numpy = { + DType.BOOL: np.bool, + DType.UINT8: np.uint8, + DType.INT8: np.int8, + DType.INT16: np.int16, + DType.INT32: np.int32, + DType.FLOAT: np.float32, +} + # TODO duplicate of tflite_mapping def underscore_to_camel_case(s): -- cgit v1.2.1