this is what they mean:
# input is 4 x 2 x 388 x 388 raw ouputs of linear.

logits = F.log_softmax(input)

# Here, an undocumented thing is that if input is 4D, softmax is applied in dimension 1. i.e. for each pixel location, you have a softmax applied over channels.

m = nn.NLLLoss2d()

loss = m(logits, target)
# here target is of shape 4 x 1 x 388 x 388