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

github.com/torch/nn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJonathan Tompson <tompson@cims.nyu.edu>2014-06-27 00:49:34 +0400
committerJonathan Tompson <tompson@cims.nyu.edu>2014-06-27 00:49:34 +0400
commit4277fa288712f75e6393901461f82f42b5c46fd3 (patch)
treeae5304ff2ea4890de5330f88106e81c90f7fb81e /test
parentf6842e9432955daae9d003deb4194c1ba467d8f4 (diff)
removed fprop test for SpatialUpSamplingNearest.
Diffstat (limited to 'test')
-rw-r--r--test/test.lua40
1 files changed, 0 insertions, 40 deletions
diff --git a/test/test.lua b/test/test.lua
index 7a23c5e..5e4bce7 100644
--- a/test/test.lua
+++ b/test/test.lua
@@ -1907,46 +1907,6 @@ function nntest.SpatialUpSamplingNearest()
local ferr, berr = jac.testIO(m, input)
mytester:asserteq(ferr, 0, torch.typename(m)..' - i/o forward err ')
mytester:asserteq(berr, 0, torch.typename(m)..' - i/o backward err ')
-
- -- Also check that the forward prop is correct.
- input = torch.rand(unpack(shape))
- local output = m:forward(input)
-
- local feat
- local nfeats
- if input:dim() == 3 then
- nfeats = shape[1]
- feat = {0}
- else
- feat = {0, 0}
- nfeats = shape[1] * shape[2]
- end
- feat[#feat+1] = 0 -- ydim
- feat[#feat+1] = 0 -- xdim
- local xdim = input:dim()
- local ydim = input:dim()-1
- local err = 0
- for f = 1, nfeats do
- if input:dim() == 4 then
- feat[1] = math.floor((f-1) / shape[1]) + 1
- feat[2] = math.mod((f-1), shape[2]) + 1
- else
- feat[1] = f
- end
- for y = 1, input:size(ydim) * scale do
- for x = 1, input:size(xdim) * scale do
- feat[ydim] = y
- feat[xdim] = x
- local oval = output[feat]
- feat[ydim] = math.floor((y-1)/scale)+1
- feat[xdim] = math.floor((x-1)/scale)+1
- local ival = input[feat]
- err = math.max(err, math.abs(oval-ival))
- end
- end
- end
-
- mytester:assertlt(err, precision, ' fprop is incorrect ')
end
end