torch / torch7

http://torch.ch
Other
8.97k stars 2.38k forks source link

Methods from math returning nil value #957

Closed dumorgan closed 7 years ago

dumorgan commented 7 years ago

Some methods described in the maths.md doc page are returning nil value for me, for example:

th> torch.lshift() [string "_RESULT={torch.lshift()}"]:1: attempt to call field 'lshift' (a nil value) stack traceback: [string "_RESULT={torch.lshift()}"]:1: in main chunk [C]: in function 'xpcall' /home/morgan/torch/install/share/lua/5.1/trepl/init.lua:661: in function 'repl' ...rgan/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:204: in main chunk [C]: at 0x00405d50

soumith commented 7 years ago

they require the latest version of torch. luarocks install torch will get you the latest version of torch and fix the issue.

dumorgan commented 7 years ago

I tried doing that before opening the issue but I did not work, I also tried luarocks remove torch --force before reinstalling without success

soumith commented 7 years ago

there's likely a global install of torch loading old files or something. You can try running this script to clean old installs / global files: https://github.com/torch/ezinstall/blob/master/clean-old.sh

dumorgan commented 7 years ago

It worked, thank you!