From 5dcc89cb11260e97f70455152fbffa13ee93717b Mon Sep 17 00:00:00 2001 From: Le Blevec <hlebleve@amd.com> Date: Thu, 18 Aug 2022 16:25:28 +0100 Subject: [PATCH] [Streamline] Updating the transformation to check if the input is in the expected format. --- src/finn/transformation/streamline/reorder.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/finn/transformation/streamline/reorder.py b/src/finn/transformation/streamline/reorder.py index e36de2aa5..2fd8f36d6 100644 --- a/src/finn/transformation/streamline/reorder.py +++ b/src/finn/transformation/streamline/reorder.py @@ -735,6 +735,12 @@ class MakeScaleResizeNHWC(Transformation): for n in graph.node: node_ind += 1 if n.op_type == "Upsample" or n.op_type == "Resize": + if model.get_tensor_layout(n.input[0]) != DataLayout.NCHW: + warnings.warn( + "%s: Input not NCHW. Can't operate transformation on node." + % n.name + ) + continue consumer = model.find_consumer(n.output[0]) producer = model.find_producer(n.input[0]) if n.op_type == "Upsample": -- GitLab