Replaced torch.abs with math.abs.
authorFrancois Fleuret <francois@fleuret.org>
Sat, 14 Jan 2017 17:09:39 +0000 (18:09 +0100)
committerFrancois Fleuret <francois@fleuret.org>
Sat, 14 Jan 2017 17:09:39 +0000 (18:09 +0100)
test-dagnn.lua

index 9f343a9..5d8a309 100755 (executable)
@@ -57,7 +57,7 @@ function checkGrad(model, criterion, input, target)
       local num = (loss1 - loss0) / (2 * epsilon)
 
       if num ~= ana then
-         err = math.max(err, torch.abs(num - ana) / torch.abs(num))
+         err = math.max(err, math.abs(num - ana) / math.abs(num))
       end
    end