From 330d4b1ab0d15381895adbdc18c58a77793d5f65 Mon Sep 17 00:00:00 2001 From: Yaman Umuroglu <maltanar@gmail.com> Date: Fri, 11 Sep 2020 11:28:39 +0200 Subject: [PATCH] [Transformation] comment + check empty name in GiveReadableTensorNames --- src/finn/transformation/general.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/finn/transformation/general.py b/src/finn/transformation/general.py index 8ad59d2ba..02f95b14e 100644 --- a/src/finn/transformation/general.py +++ b/src/finn/transformation/general.py @@ -111,8 +111,9 @@ class GiveRandomTensorNames(Transformation): class GiveReadableTensorNames(Transformation): - """Give more human-readable names to all internal tensors. It's recommended - to apply give_unique_node_names prior to this transform.""" + """Give more human-readable names to all internal tensors. You should + apply GiveUniqueNodeNames prior to this transform to avoid empty node names, + as the readable names are based on the node names.""" def apply(self, model): # to ensure we can use rename_tensor safely (without renaming existing @@ -120,6 +121,7 @@ class GiveReadableTensorNames(Transformation): model = model.transform(GiveRandomTensorNames()) graph = model.graph for n in graph.node: + assert n.name != "", "Found empty node name" out_num = 0 for o in n.output: model.rename_tensor(o, "%s_out%d" % (n.name, out_num)) -- GitLab