diff options
author | Tim Zaman <timbobel@gmail.com> | 2016-10-04 17:30:15 +0300 |
---|---|---|
committer | Tim Zaman <timbobel@gmail.com> | 2016-10-04 17:30:15 +0300 |
commit | f682842c84eff4885eb98bc6b51f70632186eb77 (patch) | |
tree | f71b90e443f6db18cf8a260f9f2bfcb93e520a5c | |
parent | 9f65c30167b2048ecbe8b7befdc6b2d6d12baee9 (diff) |
Fixes warp type-fixing issue in #189
-rw-r--r-- | init.lua | 1 | ||||
-rw-r--r-- | test/test_warp.lua | 7 |
2 files changed, 7 insertions, 1 deletions
@@ -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') |