Revert "MLBEDSW-3219: Suppress CPU info for Const/Placeholder"
This reverts commit 04986c0016e59993563490fe67052371fc0e1ad2.
Reason for revert: Merged by mistake
Change-Id: I150ad9ba7074ad1e80f21180aeba56a454d9f748
diff --git a/ethosu/vela/operation.py b/ethosu/vela/operation.py
index 9c43855..710511c 100644
--- a/ethosu/vela/operation.py
+++ b/ethosu/vela/operation.py
@@ -271,9 +271,6 @@
def needs_bias(self):
return bool(self.info.indices.biases)
- def is_startup_init_op(self):
- return self in (Op.Const, Op.Placeholder, Op.SubgraphInput)
-
@classmethod
def op_set(cls, predicate):
# Returns the set of all operator codes that fulfill the given predicate
diff --git a/ethosu/vela/pass_packing.py b/ethosu/vela/pass_packing.py
index db30cd6..5673c2d 100644
--- a/ethosu/vela/pass_packing.py
+++ b/ethosu/vela/pass_packing.py
@@ -90,7 +90,7 @@
cpu_ops = set((Op.Softmax, Op.LRN, Op.Shape, Op.Pad, Op.AddN)) | quantization_ops
npu_dma_ops = set((Op.DMA,))
-startup_init_ops = Op.op_set(Op.is_startup_init_op)
+startup_init_ops = set((Op.Const, Op.Placeholder, Op.SubgraphInput))
memory_only_ops = set((Op.Squeeze, Op.Reshape, Op.QuantizedReshape, Op.ExpandDims,))
diff --git a/ethosu/vela/supported_operators.py b/ethosu/vela/supported_operators.py
index 18496c5..4e98912 100644
--- a/ethosu/vela/supported_operators.py
+++ b/ethosu/vela/supported_operators.py
@@ -137,8 +137,7 @@
def is_operator_supported(self, op):
if op.type not in SupportedOperators.supported_operators:
- if not op.type.is_startup_init_op():
- print('Info: "{}" is not supported on the NPU. Placing on CPU instead'.format(op.type))
+ print('Info: "{}" is not supported on the NPU. Placing on CPU instead'.format(op.type))
return False
for constraint in self.generic_constraints:
valid, extra = constraint(op)
diff --git a/ethosu/vela/tflite_writer.py b/ethosu/vela/tflite_writer.py
index 4cb5df1..e24aa28 100644
--- a/ethosu/vela/tflite_writer.py
+++ b/ethosu/vela/tflite_writer.py
@@ -77,7 +77,7 @@
self.scratch_fast_buf_id = 1 # Always assign scratch_fast to buffer 1
self.buffers_to_write = [] # have an empty array there
- self.ops_to_ignore = Op.op_set(Op.is_startup_init_op)
+ self.ops_to_ignore = set((Op.Const, Op.Placeholder, Op.SubgraphInput))
self.tensors_to_reshape = {}