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

github.com/clementfarabet/lua---nnx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas LĂ©onard <nick@nikopia.org>2017-02-16 22:08:22 +0300
committerGitHub <noreply@github.com>2017-02-16 22:08:22 +0300
commitc93cebdb775bbc46991d3446919fdb5470143615 (patch)
tree1621e7dfd618c17f71bf8fa2ebd87059e310b8be
parentb52bcd0fc9375fbc89756cbc047b9a2af5a191e3 (diff)
parentd84e87e0c8b900c659e06b58c065846fb1d5b4c2 (diff)
Merge pull request #68 from twitter-forks/master
fix dependency bug
-rw-r--r--ZeroGrad.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/ZeroGrad.lua b/ZeroGrad.lua
index 83f88d2..446b25d 100644
--- a/ZeroGrad.lua
+++ b/ZeroGrad.lua
@@ -1,4 +1,9 @@
-local ZeroGrad, parent = torch.class("nn.ZeroGrad", "nn.Module")
+local ZeroGrad, parent
+if nn.ZeroGrad then -- prevent name conflicts with rnn
+ ZeroGrad, parent = nn.ZeroGrad, nn.Module
+else
+ ZeroGrad, parent = torch.class('nn.ZeroGrad', 'nn.Module')
+end
local function recursiveZero(t1,t2)
if torch.type(t2) == 'table' then