nn.NLLLoss doesn't support 3D data?=

I try to use nn.NLLLoss to implement the cross-entropy loss for 3D data, while there is a error reported:

Error: ValueError: Expected 2 or 4 dimensions (got 5)

Can anyone help what’s wrong with it? Or the NLLLoss only support 2D or 1D data?

Thanks.

I got it, it’s because the version issue…