In [4]:
require 'cudnn';

In [5]:
softmax = cudnn.SpatialLogSoftMax():cuda()

In [6]:
x = torch.randn(1,11,1,1):fill(1)

In [7]:
s:forward(x:cuda())


Out[7]:
(1,1,.,.) = 
 -2.3979

(1,2,.,.) = 
 -2.3979

(1,3,.,.) = 
 -2.3979

(1,4,.,.) = 
 -2.3979

(1,5,.,.) = 
 -2.3979

(1,6,.,.) = 
 -2.3979

(1,7,.,.) = 
 -2.3979

(1,8,.,.) = 
 -2.3979

(1,9,.,.) = 
 -2.3979

(1,10,.,.) = 
 -2.3979

(1,11,.,.) = 
 -2.3979
[torch.CudaTensor of size 1x11x1x1]


In [1]:
torch.log(1/11)


Out[1]:
-2.3978952727984