hughperkins / clnn

OpenCL backend for Torch nn neural networks library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

inplace ReLU does not work

szagoruyko opened this issue · comments

th> m = nn.ReLU(true):cl()
                                                                      [0.0001s]
th> m:forward(torch.ClTensor(8))
Using Apple platform: Apple
Using device: HD Graphics 4000
/usr/local/share/lua/5.1/clnn/Threshold.lua:8: attempt to index field 'input' (a nil value)
stack traceback:
    /usr/local/share/lua/5.1/clnn/Threshold.lua:8: in function 'Threshold_updateOutput'
    /usr/local/share/lua/5.1/nn/Threshold.lua:20: in function 'forward'
    [string "_RESULT={m:forward(torch.ClTensor(8))}"]:1: in main chunk
    [C]: in function 'xpcall'
    /usr/local/share/lua/5.1/trepl/init.lua:630: in function 'repl'
    /usr/local/lib/luarocks/rocks/trepl/scm-1/bin/th:185: in main chunk
    [C]: at 0x0106c38400

Hmmm, interesting. Will check. (Note: can reproduce this on my own system ok)

So, just to check, with inplace=true, it should actually modify the incoming input data, is that right? (edit: ok, just checked, on nn, and yes, it modifies the incoming 'input' data)

Try now?

yes it should modify input data, thanks it works now

Ok, cool :-)