hughperkins / clnn

OpenCL backend for Torch nn neural networks library
BSD 2-Clause "Simplified" License
126 stars 16 forks source link

inplace ReLU does not work #1

Closed szagoruyko closed 9 years ago

szagoruyko commented 9 years ago
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
hughperkins commented 9 years ago

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

hughperkins commented 9 years ago

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)

hughperkins commented 9 years ago

Try now?

szagoruyko commented 9 years ago

yes it should modify input data, thanks it works now

hughperkins commented 9 years ago

Ok, cool :-)