function sum_(x, axis = null, keepDims = false) {
    let $x = (0, _tensorUtilEnv.convertToTensor)(x, "x", "sum");
    if ($x.dtype === "bool") $x = (0, _cast.cast)($x, "int32");
    const inputs = {
        x: $x
    };
    const attrs = {
        axis,
        keepDims
    };
    return (0, _engine.ENGINE).runKernel((0, _kernelNames.Sum), inputs, attrs);
}
Computes the sum of elements across dimensions of a `tf.Tensor`.

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

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

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

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

const axis = 1;
x.sum(axis).print();  // or tf.sum(x, axis)
```

@param x The input tensor to compute the sum over. If the dtype is `bool`
  it will be converted to `int32` and the output dtype will be `int32`.
@param axis The dimension(s) to reduce. By default it reduces
    all dimensions.
@param keepDims If true, retains reduced dimensions with size 1.

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