尝试索引全局 'torch'(一个零值)

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

当我在 ZeroBraneStudio 中 运行 一段简单的代码 a = torch.Tensor(5,3) 时,我收到以下错误:

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

这是否意味着ZeroBraneStudio不识别Torch

确保您 select Torch 作为解释器 (Project | Lua Interpreter | Torch-7) 并从 torch 配置您的 th 或 luajit 可执行文件的路径(如 this post 中所述)。