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

github.com/torch/cunn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Chanan <gchanan@fb.com>2016-11-16 01:31:36 +0300
committerGregory Chanan <gchanan@fb.com>2016-11-16 01:31:36 +0300
commite94d55c84f79c03042e920941bf9c465f85f9059 (patch)
tree439a05b91c456f58eb1258b8aeb7e07bca145869
parent7972f85a4b7e4873de3e867d3cb6c4374051984b (diff)
Small test fixes for contiguous tests.
-rw-r--r--test.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/test.lua b/test.lua
index 7cb2854..f444e10 100644
--- a/test.lua
+++ b/test.lua
@@ -4785,9 +4785,10 @@ function cunntest.PReLU_forward()
local nOutputPlane = 8
local w = math.random(1,100)
local h = math.random(1,100)
- local input = torch.randn(nOutputPlane,h,w)
for k, typename in ipairs(typenames) do
+ local input = torch.randn(nOutputPlane,h,w):type(typename)
+
local ctype = t2cpu[typename]
local input = input:type(ctype)
local sconv = nn.PReLU(nOutputPlane):type(ctype)
@@ -5036,9 +5037,9 @@ function cunntest.VolumetricDilatedConvolution()
local dilationW = math.random(1,10)
local dilationH = math.random(1,10)
local dilationT = math.random(1,10)
- local ini = (outi - 1) * si - 2 * padW + dilationW * (ki-1) + 1
- local inj = (outj - 1) * sj - 2 * padH + dilationH * (kj-1) + 1
- local ink = (outk - 1) * sk - 2 * padT + dilationT * (kk-1) + 1
+ local ini = math.max((outi - 1) * si - 2 * padW + dilationW * (ki-1) + 1, ki)
+ local inj = math.max((outj - 1) * sj - 2 * padH + dilationH * (kj-1) + 1, kj)
+ local ink = math.max((outk - 1) * sk - 2 * padT + dilationT * (kk-1) + 1, kk)
for k, typename in ipairs(typenames) do
local input = torch.randn(from,ink,inj,ini):type(typename)