The dim parameter dictates across which dimension the softmax operations is done. Basically, the softmax operation will transform your input into a probability distribution i.e. the sum of all elements will be 1. I wrote this small example which shows the difference between using dim=0 or dim=1 for a 2D input tensor (supposing the first dimension for the batch size, and the second for the number of classes).
    # input tensor of dimensions B x C, B = number of batches, C = number of classes.
    inputs = torch.rand(size=(4, 4), dtype=torch.float32)
    soft_dim0 = torch.softmax(inputs, dim=0)
    soft_dim1 = torch.softmax(inputs, dim=1)
    print('**** INPUTS ****')
    print(inputs)
    print('**** SOFTMAX DIM=0 ****')
    print(soft_dim0)
    print('**** SOFTMAX DIM=1 ****')
    print(soft_dim1)

**** INPUTS ****
tensor([[0.1837, 0.5578, 0.0020, 0.8504],
        [0.7583, 0.3940, 0.7474, 0.0036],
        [0.5544, 0.8078, 0.4304, 0.7569],
        [0.3422, 0.6562, 0.8809, 0.7006]])
**** SOFTMAX DIM=0 ****
tensor([[0.1853, 0.2361, 0.1418, 0.3124],
        [0.3291, 0.2004, 0.2989, 0.1340],
        [0.2684, 0.3031, 0.2177, 0.2846],
        [0.2171, 0.2605, 0.3416, 0.2690]])
**** SOFTMAX DIM=1 ****
tensor([[0.1910, 0.2777, 0.1593, 0.3720],
        [0.3171, 0.2202, 0.3136, 0.1491],
        [0.2275, 0.2931, 0.2009, 0.2785],
        [0.1814, 0.2483, 0.3108, 0.2595]])

As you can see, for the softmax with dim=0, the sum of each column =1, while for dim=1, it is the sum of the rows that equals 1. Usually, you do not want to perform a softmax operation across the batch dimension.
Hope this helps!