diff options
author | Anton Bakhtin <anton@(surname).ru> | 2015-04-04 13:23:45 +0300 |
---|---|---|
committer | Anton Bakhtin <anton@(surname).ru> | 2015-04-04 13:23:45 +0300 |
commit | c1525e68611eee69d401bc5e0e5161fad8614d55 (patch) | |
tree | 43997212db80e7824d79923f4ebfd1ca1e32c0f5 /SoftMaxTree.lua | |
parent | b10c3aa2b51b3c6c848c4d8d2c2517ac59872269 (diff) |
Fix SoftMaxTree:sharedClone
See https://github.com/clementfarabet/lua---nnx/issues/35
Diffstat (limited to 'SoftMaxTree.lua')
-rw-r--r-- | SoftMaxTree.lua | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/SoftMaxTree.lua b/SoftMaxTree.lua index e3ff61e..7ca6c5e 100644 --- a/SoftMaxTree.lua +++ b/SoftMaxTree.lua @@ -325,10 +325,8 @@ function SoftMaxTree:sharedClone() smt.childParent = self.childParent smt.maxFamilyPath = self.maxFamilyPath smt.maxDept = self.maxDept - if not self.accUpdate then - smt.gradWeight = self.gradWeight:clone() - smt.gradBias = self.gradBias:clone() - end + smt.gradWeight = self.gradWeight + smt.gradBias = self.gradBias if type == 'torch.CudaTensor' then smt.parentChildrenCuda = self.parentChildrenCuda smt.childParentCuda = self.childParentCuda |