import torch
import torch.nn as nn
import torch.nn.functional as F


x = torch.rand(4, 5) * 100
y_1 = nn.LogSoftmax(dim=-1)(x)
y_2 = torch.log(F.softmax(x, dim=-1))

print((y_1 - y_2).abs().max())  # 3e-8

See here 4.