aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/tosa_mapping.py
diff options
context:
space:
mode:
Diffstat (limited to 'ethosu/vela/tosa_mapping.py')
-rw-r--r--ethosu/vela/tosa_mapping.py11
1 files changed, 11 insertions, 0 deletions
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):