Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/cwrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonan Collobert <ronan@collobert.com>2012-10-22 23:55:03 +0400
committerRonan Collobert <ronan@collobert.com>2012-10-22 23:55:03 +0400
commita8708bf380c939335717537c2156e570d52c7dea (patch)
treea5620c94be6919a94aeb71f2f0b5104e23e79b16
parent76da69bf0064c44d37727ad491b7eda46394e4a2 (diff)
wrap package: fix in IndexTensor
-rw-r--r--types.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/types.lua b/types.lua
index 052bfe3..059ec12 100644
--- a/types.lua
+++ b/types.lua
@@ -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,