mlx.core.logsumexp

目錄

mlx.core.logsumexp#

logsumexp(a: array, /, axis: None | int | Sequence[int] = None, keepdims: bool = False, *, stream: None | Stream | Device = None) array#

A log-sum-exp reduction over the given axes.

The log-sum-exp reduction is a numerically stable version of:

log(sum(exp(a), axis))
參數:
  • a (array) -- Input array.

  • axis (int or list(int), optional) -- Optional axis or axes to reduce over. If unspecified this defaults to reducing over the entire array.

  • keepdims (bool, optional) -- Keep reduced axes as singleton dimensions, defaults to False.

回傳:

The output array with the corresponding axes reduced.

回傳型別:

array