function slice_(x, begin, size) {
    const $x = (0, _tensorUtilEnv.convertToTensor)(x, "x", "slice", "string_or_numeric");
    if ($x.rank === 0) throw new Error("Slicing scalar is not possible");
    const inputs = {
        x: $x
    };
    const attrs = {
        begin,
        size
    };
    return (0, _engine.ENGINE).runKernel((0, _kernelNames.Slice), inputs, attrs);
}
Extracts a slice from a `tf.Tensor` starting at coordinates `begin`
and is of size `size`.

Also available are stricter rank-specific methods with the same signature
as this method that assert that `x` is of the given rank:
  - `tf.slice1d`
  - `tf.slice2d`
  - `tf.slice3d`
  - `tf.slice4d`

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

x.slice([1], [2]).print();
```

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

x.slice([1, 0], [1, 2]).print();
```
@param x The input `tf.Tensor` to slice from.
@param begin The coordinates to start the slice from. The length can be
    less than the rank of x - the rest of the axes will have implicit 0 as
    start. Can also be a single number, in which case it specifies the
    first axis.
@param size The size of the slice. The length can be less than the rank of
    x - the rest of the axes will have implicit -1. A value of -1 requests
    the rest of the dimensions in the axis. Can also be a single number,
    in which case it specifies the size of the first axis.

@doc {heading: 'Tensors', subheading: 'Slicing and Joining'}