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

github.com/torch/image.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Zaman <timbobel@gmail.com>2016-10-04 17:30:15 +0300
committerTim Zaman <timbobel@gmail.com>2016-10-04 17:30:15 +0300
commitf682842c84eff4885eb98bc6b51f70632186eb77 (patch)
treef71b90e443f6db18cf8a260f9f2bfcb93e520a5c
parent9f65c30167b2048ecbe8b7befdc6b2d6d12baee9 (diff)
Fixes warp type-fixing issue in #189
-rw-r--r--init.lua1
-rw-r--r--test/test_warp.lua7
2 files changed, 7 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index 4d9350e..59c17a2 100644
--- a/init.lua
+++ b/init.lua
@@ -954,7 +954,6 @@ local function warp(...)
dok.error('Incorrect arguments (clamp_mode is not clamp | pad)!', 'image.warp')
end
- local field = field:typeAs(torch.Tensor()) -- coerce matrix to default tensor type
local dim2 = false
if src:nDimension() == 2 then
dim2 = true
diff --git a/test/test_warp.lua b/test/test_warp.lua
index 5c4a1ed..eb0a88e 100644
--- a/test/test_warp.lua
+++ b/test/test_warp.lua
@@ -137,3 +137,10 @@ image.display{image = im_lanczos, zoom = 4, legend = 'rotation lanczos (pad 1)'}
image.display{image = im, zoom = 4, legend = 'source image'}
+-- ***********************************************
+-- NOW MAKE SURE BOTH FLOAT AND DOUBLE INPUTS WORK
+-- ***********************************************
+
+mtx = torch.zeros(2, 32, 32)
+out = image.warp(im:float(), mtx:float(), 'bilinear')
+out = image.warp(im:double(), mtx:double(), 'bilinear')