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

github.com/torch/optim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2016-02-28 04:05:38 +0300
committerSoumith Chintala <soumith@gmail.com>2016-02-28 04:05:38 +0300
commit5e11b9fc448f3612c93429dbd125c8aa0862d3d5 (patch)
treef1270b5a18d3c14d168e4c3f7fb1d2535cf911cf
parented499bdb9b8b343bf058b7eb0cec3c5efc5c421d (diff)
parent5b10f21694cc07ab359c01061ac44b23c5469745 (diff)
Merge pull request #96 from donglixp/patch-1
checkgrad.lua: tensor type bug when using gpu
-rw-r--r--checkgrad.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/checkgrad.lua b/checkgrad.lua
index 6ab200e..aecb969 100644
--- a/checkgrad.lua
+++ b/checkgrad.lua
@@ -25,7 +25,7 @@ function optim.checkgrad(opfunc, x, eps)
-- compute numeric approximations to gradient:
local eps = eps or 1e-7
- local dC_est = torch.DoubleTensor(dC:size())
+ local dC_est = torch.Tensor():typeAs(dC):resizeAs(dC)
for i = 1,dC:size(1) do
x[i] = x[i] + eps
local C1 = opfunc(x)