The ignore_index argument just masks the loss for the current class.
From the docs:

ignore_index (int, optional) – Specifies a target value that is ignored and does not contribute to the input gradient. When size_average is True, the loss is averaged over non-ignored targets.

If you would like to ignore it in the prediction, you could just slice the output:
torch.randn(1, 5)
_, preds = torch.max(output[0, 1:], 0)