The dim parameter defines over which dimension of the tensor you are taking a mean. In your case, dim=0
t = [[1,2],
     [3,4]]
t.mean(dim=0) = [(1+3)/2, (2+4)/2] = [2,3]

For dim=1,
t = [[1,2],
     [3,4]]
t.mean(dim=1) = [(1+2)/2, (3+4)/2] = [1.5,3.5]

Hope this helps!
Regards