MLBEDSW-3148: Refactor Operation
- op.type is now an enum instead of a string
- Removed unused operator codes
- Refactored some attributes like npu_block_type, fused_activation_function
- Refactored operator index calculation
- Refactored a number of operator sets
Change-Id: I641f65ee375794b7aec42abc0664251ae37d78e8
Signed-off-by: Louis Verhaard <louis.verhaard@arm.com>
diff --git a/ethosu/vela/stats_writer.py b/ethosu/vela/stats_writer.py
index 2ea14f2..6fd68f8 100644
--- a/ethosu/vela/stats_writer.py
+++ b/ethosu/vela/stats_writer.py
@@ -25,6 +25,7 @@
from .npu_performance import MacCount
from .npu_performance import PassCycles
from .numeric_util import round_up_to_int
+from .operation import Op
from .tensor import MemArea
from .tensor import TensorPurpose
@@ -192,11 +193,11 @@
continue # skip the dummy init pass
for ps in cps.passes:
- if len(ps.ops) == 1 and ps.ops[0].type == "NpuOp":
+ if len(ps.ops) == 1 and ps.ops[0].type == Op.CustomNpuOp:
# just treat this as a call, unroll it
write_subgraph(ps.ops[0].attrs["subgraph"])
continue
- stats = [ps.name, " ".join(op.type for op in ps.ops)]
+ stats = [ps.name, " ".join(op.type.name for op in ps.ops)]
stats += [ps.placement.name]
stats += [cps.strategy.name]
stats += list(ps.block_config)