diff options
author | Soumith Chintala <soumith@gmail.com> | 2015-04-25 00:51:00 +0300 |
---|---|---|
committer | Soumith Chintala <soumith@gmail.com> | 2015-04-25 00:51:00 +0300 |
commit | af5084f24896d9960304a1cef1609d59edc9e733 (patch) | |
tree | ef1d3f9d1b34827e9dd6753bf973caa8700d3771 /init.lua | |
parent | f69696b33f4e551c2989989c474139bb8bbe1040 (diff) | |
parent | fa985e6800c8c8d3ac7d3a0625e345dd8809f8c6 (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-x | init.lua | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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() |