Like tf.math.reduce_logsumexp.

This has no functional difference from the regular version, except that it's implemented inline here, allowing monkey-patching of the special functions it uses (e.g. exp).

a A tensor.
axis Dimensions to reduce. If None, reduces all dimensions.
keepdims If True, retains the reduced dimensions with length 1.
name Name for the op.

y The reduced tensor.