• Computes the log(sum(exp(elements across the reduction dimensions))).

    Reduces the input along the dimensions given in axis. Unless keepDims is true, the rank of the array is reduced by 1 for each entry in axis. If keepDims is true, the reduced dimensions are retained with length 1. If axis has no entries, all dimensions are reduced, and an array with a single element is returned.

    const x = tf.tensor1d([1, 2, 3]);

    x.logSumExp().print(); // or tf.logSumExp(x)
    const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);

    const axis = 1;
    x.logSumExp(axis).print(); // or tf.logSumExp(a, axis)

    Type Parameters

    Parameters

    • x: Tensor<Rank> | TensorLike

      The input tensor.

    • Optional axis: number | number[]

      The dimension(s) to reduce. If null (the default), reduces all dimensions.

    • Optional keepDims: boolean

      If true, retains reduced dimensions with length of 1. Defaults to false.

    Returns T

    Doc

Generated using TypeDoc