To clarify: you want to calculate the standard softmax BUT you want to ignore any zero values.
In other words for the first row you remove the zero, then you calculatesoftmax([1,3]), and then you reinsert the zero into the output.
Is that right?
If so, I am stumped. Maybe someone else can help.