Select Dimension for LogSoftMax

Suppose I have an n-dimensional tensor and would like to apply LogSoftmax on a given dimension.
Currently I am unable to do so. Although the documentation (http://pytorch.org/docs/master/_modules/torch/nn/modules/activation.html#LogSoftmax ) states that dim can be passed to the constructor, but when I try to do something like

soft_max = nn.LogSoftmax(3) ,
I get an error saying 'TypeError: __init__() takes exactly 1 argument (2 given)'

So, am I doing something wrong, or is the feature currently un-implemented? Also, what is the default dimension on which the softmax is applied?

The dim kwarg is implemented after 0.2.0 release. Therefore, if you didn’t install from source, you likely don’t have that available right now. Please refer to this doc on 0.2.0 http://pytorch.org/docs/0.2.0/_modules/torch/nn/modules/activation.html#LogSoftmax.

The default dimension selection is something weird… IIRC, it is 0 if input is 1-dim or 3-dim and 1 otherwise. It will be deprecated in the next version.