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:
authorIvo Danihelka <danihelka@google.com>2015-12-18 19:56:04 +0300
committerIvo Danihelka <danihelka@google.com>2015-12-18 19:56:04 +0300
commitf290385da6c6e553b9c5d6966fe454e5b45a88ff (patch)
tree7facc0cc09a782d378dfe5357c9a502cbb4b2380 /node.lua
parenta4cc6c9fbad6fb322fcd69937d67c5183f6fcc37 (diff)
Allow to do node:split(1).
Diffstat (limited to 'node.lua')
-rw-r--r--node.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/node.lua b/node.lua
index 3842605..a55aa48 100644
--- a/node.lua
+++ b/node.lua
@@ -46,7 +46,9 @@ end
-- that each take a single component of the output of this
-- node in the order they are returned.
function nnNode:split(noutput)
- assert(noutput >= 2, "splitting to one output is not supported")
+ if noutput == 1 then
+ return nngraph.JustElement()(self)
+ end
local debugLabel = self.data.annotations._debugLabel
-- Specify the source location where :split is called.
local dinfo = debug.getinfo(2, 'Sl')