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>2015-04-25 00:51:00 +0300
committerSoumith Chintala <soumith@gmail.com>2015-04-25 00:51:00 +0300
commitaf5084f24896d9960304a1cef1609d59edc9e733 (patch)
treeef1d3f9d1b34827e9dd6753bf973caa8700d3771 /init.lua
parentf69696b33f4e551c2989989c474139bb8bbe1040 (diff)
parentfa985e6800c8c8d3ac7d3a0625e345dd8809f8c6 (diff)
Merge pull request #63 from jonathantompson/hflip_vflip_assert_fix
modifed h/vflip assert to only check if 2D tensors are contiguous (maintaining backward compat.)
Diffstat (limited to 'init.lua')
-rwxr-xr-xinit.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/init.lua b/init.lua
index 5fc8243..d204d1e 100755
--- a/init.lua
+++ b/init.lua
@@ -813,8 +813,8 @@ local function hflip(...)
dok.error('incorrect arguments', 'image.hflip')
end
- if not src:isContiguous() then
- dok.error('input tensor is not contiguous', 'image.hflip')
+ if (src:dim() == 2) and (not src:isContiguous()) then
+ dok.error('2D input tensor is not contiguous', 'image.hflip')
end
dst = dst or src.new()
@@ -855,8 +855,8 @@ local function vflip(...)
dok.error('incorrect arguments', 'image.vflip')
end
- if not src:isContiguous() then
- dok.error('input tensor is not contiguous', 'image.vflip')
+ if (src:dim() == 2) and (not src:isContiguous()) then
+ dok.error('2D input tensor is not contiguous', 'image.vflip')
end
dst = dst or src.new()