torch/torch7 — pull request #15 by timharley (2014-03-12 10:56:45+00:00)
Title: Stop __index__ and __newindex__ leaking a tensor during torch.test()

This change fixes leaks that occur during the tests - but not all possible leaks from `__index__` and `__newindex__`

Any `luaL_argcheck` after this line:

> tensor = THTensor_(newWithTensor)(tensor);

Will cause tensor to leak.

There are ~8 other `luaL_argcheck` lines across these two functions which the tests don't hit that will do this - is it worth fixing them?