In 0.3.0, you’d have to do the following workaround. You can reshape your input into a 4D tensor and your target into a 3D tensor, and send them into the loss function, as so:
input_4d = input.view(1, 2, 64, -1)
target_3d = target.view(1, 64, -1)
loss = nn.NLLLoss(reduce=False)
out_3d = loss(input_4d, target_3d)
out = out_3d.view(1, 64, 64, 64)