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:
authorAysegul <adundar@purdue.edu>2015-08-25 18:21:23 +0300
committerAysegul <adundar@purdue.edu>2015-08-25 18:21:23 +0300
commit8cb87bd46e2c1dc1c2ca483c418bd93bc1b8fc97 (patch)
treea0760a61d52a81c087f62cb5c6e5356db4cf082b /generic
parent0dcfe839ab46537e1c65434fbc5bda18af8e8557 (diff)
add in-place error message for rotate
Diffstat (limited to 'generic')
-rwxr-xr-xgeneric/image.c8
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];