Luau-compatible fork of Torch7.
Some features needed to be removed, for the following reasons:
- Luau does not support files to protect user filesystem
- Luau does not have
FFIlibrary - Lua
numbermax representable integer is 2^53, this can hold 32 bit pointers but can not hold 64 bit ones
Removed Torch7 features:
- Whole modules
- File
- DiskFile
- MemoryFile
- PipeFile
- CmdLine
- FFInterface
- Tester
- TestSuite
- Partial features
torch.isatty(), no tty in Luautorch.TYPEStorage(size, ptr), allocating storage from Lua with a pointer + sizetorch.TYPEStorage(filename [, shared [, size [, sharedMem]]]), allocating storage from memory mapped filetorch.class(), modifies global statetorch.setheaptracking(), modifies global statetorch.setdefaulttensortype(), modifies global state- Any other function modifying the global state
Modified Torch7 features:
torch.pointer()returns hash of the pointer, only good for comparing equality
Added Torch7 features:
- Coherent noise optional library
Use the LUAU_TORCH7_EXAMPLE CMake option to compile example.cpp, and pass example.lua as first argument to the exe.
Output with LUAU_TORCH7_NOISE enabled:
1 2
3 4
[torch.FloatTensor of size 2x2]
1 1
1 1
[torch.FloatTensor of size 2x2]
2 3
4 5
[torch.FloatTensor of size 2x2]
1 1 1
1 1 1
1 1 1
[torch.FloatTensor of size 3x3]
2 2 2
2 2 2
2 2 2
[torch.FloatTensor of size 3x3]
simplex2D:
generated and filtered 5244100 values
took 0.12464120599906892 seconds
min = -0.999998927116394, max = 0.999998927116394
num of indexes = 281666
node2D:
generated and filtered 5244100 values
took 0.2929048950027209 seconds
min = -1, max = 1
num of indexes = 378937
simplex3D:
generated and filtered 5268024 values
took 0.14669220199721167 seconds
min = -0.9968256950378418, max = 0.9970061779022217
num of indexes = 375681
node3D:
generated and filtered 5268024 values
took 0.5029356320010265 seconds
min = -1, max = 1
num of indexes = 367336
tracetest3
tracetest2
tracetest1
Runtime error: [string "example.lua"]:37: example error
[string "example.lua"]:37 function tracetest1
[string "example.lua"]:42 function tracetest2
[string "example.lua"]:47 function tracetest3
[string "example.lua"]:50
Massaged Tester and TestsSuite to work with Luau.
Run build_n_test.sh to execute luau_test.lua and example.lua.
longSize.lua: TestsDiskFileandMemoryFile, does not work.test_aliasMultinomial.lua: Passes.test_half.lua: Passes.test_Multinomial.lua: Uses theFFInterfaceLongTensor:data()andLongTensor:apply(), does not work.test_qr.lua: Passes.test_sharedmem.lua: Teststorch.TYPEStorage(filename [, shared [, size [, sharedMem]]]), does not work.test_Tester.lua: Passes.test_timer.lua: Passes.test_writeObject.lua: TestsDiskFileandMemoryFile, does not work.test.lua: Passes, except a few cases testing theFile,torch.class()or global state setting features.timeSort.lua: Test measuringtorch.sortspeed, does not work.
Torch is the main package in Torch7 where data structures for multi-dimensional tensors and mathematical operations over these are defined.
- Tensor Library
- Tensor defines the all powerful tensor object that provides multi-dimensional numerical arrays with type templating.
- Mathematical operations that are defined for the tensor object types.
- Storage defines a simple storage interface that controls the underlying storage for any tensor object.
- Useful Utilities