Given matrix of shape , produce such that
NB: The shift by is required for numerical stability. Without it, overflows the f32 range as soon as exceeds .
Input
A- input matrix of shape[m][n]stored in row-major order.m- the number of rows inA.n- the number of columns inA.
Output
s- the log-sum-exp value computed from the formula above.