Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/nngraph.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkoray kavukcuoglu <koray@kavukcuoglu.org>2015-07-23 17:23:52 +0300
committerkoray kavukcuoglu <koray@kavukcuoglu.org>2015-07-23 17:23:52 +0300
commit7250e45bacb820c5f2771697f81880893f366f3c (patch)
treefe50bb38f08d5194cb315509a2641c836ef50a79
parent99919fa260dd2ca33347c06da04dce5931f9fcc8 (diff)
add randomized naming to svg file names that are auto generatedsvg_name
-rw-r--r--graphinspecting.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/graphinspecting.lua b/graphinspecting.lua
index 66a334f..7c8d462 100644
--- a/graphinspecting.lua
+++ b/graphinspecting.lua
@@ -83,6 +83,9 @@ local function onError(failedNode, gmodule)
local nInputs = gmodule.nInputs or #gmodule.innode.children
local svgPathPrefix = gmodule.name or string.format(
'nngraph_%sin_%sout', nInputs, #gmodule.outnode.children)
+ if paths.filep(svgPathPrefix .. '.svg') then
+ svgPathPrefix = svgPathPrefix .. '_' .. paths.basename(os.tmpname())
+ end
local dotStr = customToDot(gmodule.fg, svgPathPrefix, failedNode)
saveSvg(svgPathPrefix, dotStr)
end