From 7f2862ad888f091d522cd107bef5570682688de9 Mon Sep 17 00:00:00 2001 From: Aleksey Ropan Date: Tue, 21 Feb 2017 11:26:45 +0100 Subject: [PATCH] Added call setdefaulttensortype before return --- init.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index e0fbad1..5240ba8 100644 --- a/init.lua +++ b/init.lua @@ -70,7 +70,9 @@ function M.image(img, opts) opts = opts or {} if type(img) == 'table' then - return M.images(img, opts) + local result = M.images(img, opts) + torch.setdefaulttensortype(defaultType) + return result end -- img is a collection? @@ -79,7 +81,9 @@ function M.image(img, opts) for i = 1,img:size(1) do images[i] = img[i] end - return M.images(images, opts) + local result = M.images(images, opts) + torch.setdefaulttensortype(defaultType) + return result end img = normalize(img, opts)