function logSumExp_(x, axis = null, keepDims = false) {
    const $x = (0, _tensorUtilEnv.convertToTensor)(x, "x", "logSumExp");
    const axes = (0, _util.parseAxisParam)(axis, $x.shape);
    const xMax = (0, _max.max)($x, axes, true);
    const a = (0, _sub.sub)($x, xMax);
    const b = (0, _exp.exp)(a);
    const c = (0, _sum.sum)(b, axes);
    const d = (0, _log.log)(c);
    const res = (0, _add.add)((0, _reshape.reshape)(xMax, d.shape), d);
    if (keepDims) {
        const newShape = (0, _axisUtil.expandShapeToKeepDim)(res.shape, axes);
        return (0, _reshape.reshape)(res, newShape);
    }
    return res;
}
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.

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

x.logSumExp().print();  // or tf.logSumExp(x)
```

```js
const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);

const axis = 1;
x.logSumExp(axis).print();  // or tf.logSumExp(a, axis)
```
@param x The input tensor.
@param axis The dimension(s) to reduce. If null (the default),
    reduces all dimensions.
@param keepDims If true, retains reduced dimensions with length
    of 1. Defaults to false.

@doc {heading: 'Operations', subheading: 'Reduction'}