akfidjeland/torch-totem — pull request #26 by fidlej (2014-09-29 17:24:51+00:00)
Title: Allowed to check gradients with non-contiguous inputs.

When the input is not contiguous,
the checkGradients() was reporting a wrong numerical gradient.

You can reproduce the problem by:

require 'totem'
require 'nn'

local tester = totem.Tester()
local test = {}
function test.test_nonContinous()
totem.nn.checkGradients(tester, nn.Sigmoid(), torch.randn(3, 5):t())
end

tester:add(test):run()