From 219ec070cb0d1aab6b2ea8d0428d6aaa9c5c07fb Mon Sep 17 00:00:00 2001 From: Michael McGeagh Date: Mon, 9 Nov 2020 11:11:26 +0000 Subject: MLBEDSW-3402 SupportedOp now returns external name Previously the internal operator type was printed when checking the supported operator checks. This now converts that back to the external type name. Additionally removed dead code and changed the message for cpu-only ops Signed-off-by: Michael McGeagh Change-Id: Ib2b0cbcb49fdf63edb835828e266b079e63bae37 --- ethosu/vela/tflite_mapping.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ethosu/vela/tflite_mapping.py') diff --git a/ethosu/vela/tflite_mapping.py b/ethosu/vela/tflite_mapping.py index 8a53039a..bbd44b0b 100644 --- a/ethosu/vela/tflite_mapping.py +++ b/ethosu/vela/tflite_mapping.py @@ -689,3 +689,11 @@ builtin_operator_map = { builtin_operator_inv_map = {v[0]: (k, v[1]) for k, v in builtin_operator_map.items()} builtin_operator_inv_map[Op.CustomNpuOp] = (BuiltinOperator.CUSTOM, CustomOptionsSerializer()) + + +def optype_to_builtintype(op_type): + if op_type in builtin_operator_inv_map: + builtin_type = builtin_operator_inv_map[op_type][0] + return next(k for k, v in vars(BuiltinOperator).items() if v == builtin_type) + else: + return "UNKNOWN" -- cgit v1.2.1