You will not get the same value of loss.
Because,  nn.CrossEntropyLoss() will aggregate the values across all the channels.
Refer to this doc, https://pytorch.org/docs/master/generated/torch.nn.CrossEntropyLoss.html 1
If you scroll down, there will be a formula with
loss(x,class) = −x[class]+log( j∑ exp(x[j]))
The values which goes inside the summation are different, hence the loss won’t be same.
For example, considering the first element of  2nd and 3rd example,
- 0.45 + sum(exp([0.45, 0.5, 0.4])) is different than
- 0.45 + sum(exp([0.45, 0.5, 0.0])) .
And this really affects the value of loss.