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:
authorSoumith Chintala <soumith@gmail.com>2016-10-04 18:48:14 +0300
committerGitHub <noreply@github.com>2016-10-04 18:48:14 +0300
commitad5a376ca2044092d8945b5211da050f82f2fb74 (patch)
tree68d5d366f7376fc5d4550e0d14ce19dbf7986df0
parent88f4e3d98746a37b3626fbde1c87387b77f2e092 (diff)
parentf682842c84eff4885eb98bc6b51f70632186eb77 (diff)
Merge pull request #196 from TimZaman/fix/warp-type-issue
Fixes warp type-cast 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')