Skip to content

Commit

Permalink
visualize: fix node_attr on upstream master (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
iblislin authored and pluskid committed Oct 31, 2017
1 parent 3824df0 commit 41f8f55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/visualize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ function to_graphviz(network :: SymbolicNode; title="Network Visualization", inp
attr = deepcopy(node_attr)
label = op

# Up to 0.8 version of mxnet additional info was stored in
# node["param"]. Staring from pre0.9 `param` was changed to `attr`.
if haskey(node, "param")
node_info = node["param"]
# Up to 0.11.0 version of mxnet additional info was stored in
# node["attr"]. Staring from 0.12 `attr` was changed to `attrs`.
# See: https://github.com/dmlc/nnvm/pull/152
if haskey(node, "attrs")
node_info = node["attrs"]
elseif haskey(node, "attr")
node_info = node["attr"]
end
Expand Down
2 changes: 1 addition & 1 deletion test/unittest/visualize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function test_basic()
info("Visualize::basic")

mlp = mlp2()

# Order of elements or default color values can change, but length of the output should be more or less stable
@test length(mx.to_graphviz(mlp)) == length(
"""
Expand Down

0 comments on commit 41f8f55

Please sign in to comment.