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:
authorJulien Cornebise <jucor@google.com>2015-02-20 20:07:22 +0300
committerJulien Cornebise <jucor@google.com>2015-02-20 20:07:22 +0300
commit65fd3b6f53920d503a8ab2180595a438a84d6079 (patch)
treea5a0c7b97fd2d08bfd8ff67feae55beaa3b9a397
parent8122c997ff4010238d125633236ffe62258f7de7 (diff)
Revert "toDisplayTensor : input is only copied when necessary"
This reverts commit 3bc649ac0258936dfc67e5de8320faed649b6bf8. Conflicts: init.lua
-rwxr-xr-xinit.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index 49e1af7..bfda6e7 100755
--- a/init.lua
+++ b/init.lua
@@ -986,19 +986,19 @@ local function toDisplayTensor(...)
{arg='saturate', type='boolean', help='saturate (useful when min/max are lower than actual min/max', default=true}
)
- local packed
+ local packed = torch.Tensor()
if type(input) == 'table' then
-- pack images in single tensor
local ndims = input[1]:dim()
local channels = ((ndims == 2) and 1) or input[1]:size(1)
local height = input[1]:size(ndims-1)
local width = input[1]:size(ndims)
- packed = torch.Tensor(#input,channels,height,width)
+ packed:resize(#input,channels,height,width)
for i,img in ipairs(input) do
packed[i]:copy(input[i])
end
else
- packed = torch.Tensor(input:size()):copy(input)
+ packed:resize(input:size()):copy(input)
end
-- scale each