mlx_rs::ops

Function log_add_exp_device

Source
pub fn log_add_exp_device(
    a: impl AsRef<Array>,
    b: impl AsRef<Array>,
    stream: impl AsRef<Stream>,
) -> Result<Array>
Expand description

Element-wise log-add-exp.

This is a numerically stable log-add-exp of two arrays with numpy-style broadcasting semantics. Either or both input arrays can also be scalars.

The computation is is a numerically stable version of log(exp(a) + exp(b)).