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 165.
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.