clementfarabet/torchffi — pull request #2 by fidlej (2013-06-19 14:48:56+00:00)
Title: FFI implementation of apply()

I implemented a faster version of tensor:apply().
I used the fast FFI access to the tensor data.

When importing torchffi,
the apply() will be redefined for all tensors.
The newer apply is 40-times faster on my computer.
I included a simple benchmark: test/benmark_apply.lua

Is the automatic redefining of apply() OK?
Or would you like to redefine the apply() by a torchffi.enableFastApply() call?