Search code examples
luatorchzerobrane

attempt to index global 'torch' (a nil value)


When I run a simple piece of code a = torch.Tensor(5,3) in ZeroBraneStudio, I receive the following error:

attempt to index global 'torch' (a nil value)

Does this mean that ZeroBraneStudio does not recognize Torch?


Solution

  • Make sure you select Torch as the interpreter (Project | Lua Interpreter | Torch-7) and configure the path to your th or luajit executable from torch (as described in this post).