torch / nngraph

Graph Computation for nn
Other
299 stars 96 forks source link

One problem with gmodule.lua #137

Open zhangty12 opened 7 years ago

zhangty12 commented 7 years ago

On gmodule.lua : line-337, the reassignment " input = input[1] " seems problematic.

Say, if the module associated with the node is a JoinTable(1), and the input is a singleton {torch.randn(5, 5)}, the program may crash as gmodule would send a tensor torch.randn(5, 5) directly to JoinTable(1):forward(***), instead of a table {torch.randn(5, 5)}.

Therefore, when wrapped up in a gmodule, JoinTable(*):forward(***) cannot accept singletons as their inputs, and so this contradicts JoinTable's original functionality.