Z is a 2-D array of logits with shape (n, k). Return an (n, k) array whose rows are the softmax of each row of Z, computed by subtracting the row max before exponentiating so rows containing values like 1e9 do not overflow.
Input
[[ 1. 2. 3.]
[1000. 1000. 1000.]]
Output
[[0.09003057 0.24472847 0.66524096]
[0.33333333 0.33333333 0.33333333]]