PyTorch provides 2 kinds of Softmax class. The one is applying softmax along a certain dimension. The other is do softmax on a spatial matrix sized in B, C, H, W.

But it seems like some problems existing in Softmax2d. : (

 

PyTorch Softmax

PyTorch Softmax

 

 

PyTorch Softmax