Minor update.
authorFrancois Fleuret <francois@fleuret.org>
Wed, 23 Aug 2017 14:24:37 +0000 (16:24 +0200)
committerFrancois Fleuret <francois@fleuret.org>
Wed, 23 Aug 2017 14:24:37 +0000 (16:24 +0200)
agtree2dot.py
mlp.pdf

index 0f787ac..4eef05a 100755 (executable)
@@ -83,7 +83,7 @@ def fill_graph_lists(u, node_labels, node_list, link_list):
                     re.search('<class \'(.*\.|)([a-zA-Z0-9_]*)\'>', str(type(u))).group(2))
         node_list[u] = node
 
-        if isinstance(u, torch.autograd.Variable):
+        if hasattr(u, 'grad_fn'):
             fill_graph_lists(u.grad_fn, node_labels, node_list, link_list)
             add_link(node_list, link_list, u, 0, u.grad_fn, 0)
 
diff --git a/mlp.pdf b/mlp.pdf
index a950b22..ee3ebb3 100644 (file)
Binary files a/mlp.pdf and b/mlp.pdf differ