diff options
author | Aysegul <adundar@purdue.edu> | 2015-08-25 18:21:23 +0300 |
---|---|---|
committer | Aysegul <adundar@purdue.edu> | 2015-08-25 18:21:23 +0300 |
commit | 8cb87bd46e2c1dc1c2ca483c418bd93bc1b8fc97 (patch) | |
tree | a0760a61d52a81c087f62cb5c6e5356db4cf082b | |
parent | 0dcfe839ab46537e1c65434fbc5bda18af8e8557 (diff) |
add in-place error message for rotate
-rwxr-xr-x | generic/image.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/generic/image.c b/generic/image.c index 6b69900..316a8cc 100755 --- a/generic/image.c +++ b/generic/image.c @@ -401,6 +401,10 @@ static int image_(Main_rotate)(lua_State *L) src= THTensor_(data)(Tsrc); dst= THTensor_(data)(Tdst); + if (dst == src) { + luaL_error(L, "image.rotate: in-place rotate not supported"); + } + dst_stride0 = 0; dst_stride1 = Tdst->stride[Tdst->nDimension-2]; dst_stride2 = Tdst->stride[Tdst->nDimension-1]; @@ -490,6 +494,10 @@ static int image_(Main_rotateBilinear)(lua_State *L) src= THTensor_(data)(Tsrc); dst= THTensor_(data)(Tdst); + if (dst == src) { + luaL_error(L, "image.rotate: in-place rotate not supported"); + } + dst_stride0 = 0; dst_stride1 = Tdst->stride[Tdst->nDimension-2]; dst_stride2 = Tdst->stride[Tdst->nDimension-1]; |