diff options
author | Nicholas Léonard <nick@nikopia.org> | 2016-04-09 00:48:31 +0300 |
---|---|---|
committer | Nicholas Léonard <nick@nikopia.org> | 2016-04-09 00:48:31 +0300 |
commit | 54a41874947775391d233c8f02719d0da8798f6c (patch) | |
tree | 2ded1ab22c79c86ef2fa6f60a6e68cb3de9b7d96 | |
parent | 66d9f3e607e28a51a1a7da3c28e9a28680984e68 (diff) | |
parent | 7e75a910842690630b9bde5101ef35c9851c4771 (diff) |
Merge pull request #57 from SeanNaren/master
Fixed CPU gradInputs returning zeroes
-rw-r--r-- | CTCCriterion.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/CTCCriterion.lua b/CTCCriterion.lua index 22f13af..0aa4ae5 100644 --- a/CTCCriterion.lua +++ b/CTCCriterion.lua @@ -47,7 +47,8 @@ function CTCCriterion:updateGradInput(output, labels) if (output:type() == 'torch.CudaTensor') then gpu_ctc(acts, grads, labels, sizes) else - cpu_ctc(acts:float(), grads:float(), labels, sizes) + grads = grads:float() + cpu_ctc(acts:float(), grads, labels, sizes) end self.gradInput = self:revertBatching(grads, tensorSizes):typeAs(output) return self.gradInput |