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:
authormarris <marris@google.com>2015-06-18 19:38:55 +0300
committermarris <marris@google.com>2015-06-18 19:38:55 +0300
commitfed11c52fa5b3e03a0548d612d5f507b328a3800 (patch)
tree9e9f976325cf295d4762fb9b5f2acbcf326a51fa
parente7c3cdb97d5bc890f7d7fff1144bb273ffdc37f3 (diff)
Fix for using non-torch.DoubleTensor inputs to image.gaussianpyramid
-rwxr-xr-xinit.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index 89aa3a7..b19abf9 100755
--- a/init.lua
+++ b/init.lua
@@ -1954,18 +1954,18 @@ function image.gaussianpyramid(...)
end
if src:nDimension() == 2 then
for i = 1,#scales do
- dst[i] = dst[i] or torch.Tensor()
+ dst[i] = dst[i] or src.new()
dst[i]:resize(src:size(1)*scales[i], src:size(2)*scales[i])
end
elseif src:nDimension() == 3 then
for i = 1,#scales do
- dst[i] = dst[i] or torch.Tensor()
+ dst[i] = dst[i] or src.new()
dst[i]:resize(src:size(1), src:size(2)*scales[i], src:size(3)*scales[i])
end
else
dok.error('src image must be 2D or 3D', 'image.gaussianpyramid')
end
- local k = image.gaussian{width=3, normalize=true}
+ local k = image.gaussian{width=3, normalize=true}:typeAs(src)
local tmp = src
for i = 1,#scales do
if scales[i] == 1 then