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

github.com/torch/cutorch.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Gross <sgross@fb.com>2015-04-29 21:24:17 +0300
committerSam Gross <sgross@fb.com>2015-04-29 21:38:27 +0300
commitf30fc341f72ffa4fbf6af6a18fac8c81f0cecf90 (patch)
tree5e7a1e0803e711825c32ab164cb3fcb75c63320d /init.lua
parent48eb1c5a3397fb6929ac59f805299a9d56c22903 (diff)
Lua 5.2 compatibility
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index 3cb7519..b0dd20f 100644
--- a/init.lua
+++ b/init.lua
@@ -8,6 +8,8 @@ include('Tensor.lua')
include('FFI.lua')
include('test.lua')
+local unpack = unpack or table.unpack
+
function cutorch.withDevice(newDeviceID, closure)
local curDeviceID = cutorch.getDevice()
cutorch.setDevice(newDeviceID)