Skip to content

Commit b24b0e5

Browse files
committed
Fix corner-case in graphgen
Fix is included in PR #10, but I fix it here for #11
1 parent 264ccb0 commit b24b0e5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

graphgen.lua

+6-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,12 @@ local function generateGraph(net, input, opts)
199199
-- those containers effectively do some computation, so they have their
200200
-- place in the graph
201201
for i,branch in ipairs(m.modules) do
202-
local last_module = branch:get(branch:size())
202+
local last_module
203+
if branch.modules then
204+
last_module = branch:get(branch:size())
205+
else
206+
last_module = branch
207+
end
203208
local out = last_module.output
204209
local ptr = torch.pointer(out)
205210

0 commit comments

Comments
 (0)