From be8b7dd092462b877fcb1be69bcb2a576c59d371 Mon Sep 17 00:00:00 2001 From: juri200405 Date: Tue, 22 Dec 2020 16:15:26 +0900 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E9=83=A8=E3=81=AE=E3=83=91=E3=83=A9?= =?UTF-8?q?=E3=83=A1=E3=83=BC=E3=82=BF=E3=81=AE=E3=81=BF=E3=81=AB=E5=90=8D?= =?UTF-8?q?=E5=89=8D=E3=82=92=E3=81=A4=E3=81=91=E3=82=89=E3=82=8C=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit from https://github.com/szagoruyko/pytorchviz/issues/21#issuecomment-594567248 --- torchviz/dot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchviz/dot.py b/torchviz/dot.py index e5f60cb..35d18c3 100644 --- a/torchviz/dot.py +++ b/torchviz/dot.py @@ -44,7 +44,7 @@ def add_nodes(var): dot.node(str(id(var)), size_to_str(var.size()), fillcolor='orange') elif hasattr(var, 'variable'): u = var.variable - name = param_map[id(u)] if params is not None else '' + name = param_map.get(id(u), ' ') if params is not None else '' node_name = '%s\n %s' % (name, size_to_str(u.size())) dot.node(str(id(var)), node_name, fillcolor='lightblue') elif var in output_nodes: