diff options
author | Ronan Collobert <ronan@collobert.com> | 2012-10-22 23:55:03 +0400 |
---|---|---|
committer | Ronan Collobert <ronan@collobert.com> | 2012-10-22 23:55:03 +0400 |
commit | a8708bf380c939335717537c2156e570d52c7dea (patch) | |
tree | a5620c94be6919a94aeb71f2f0b5104e23e79b16 | |
parent | 76da69bf0064c44d37727ad491b7eda46394e4a2 (diff) |
wrap package: fix in IndexTensor
-rw-r--r-- | types.lua | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -109,9 +109,11 @@ wrap.argtypes.IndexTensor = { read = function(arg, idx) local txt = {} - table.insert(txt, string.format("THLongTensor_add(arg%d, arg%d, -1);", arg.i, arg.i)); + if not arg.noreadadd then + table.insert(txt, string.format("THLongTensor_add(arg%d, arg%d, -1);", arg.i, arg.i)); + end if arg.returned then - return table.insert(txt, string.format("arg%d_idx = %d;", arg.i, idx)) + table.insert(txt, string.format("arg%d_idx = %d;", arg.i, idx)) end return table.concat(txt, '\n') end, |