function gather_(x, indices, axis, batchDims) {
	  if (axis === void 0) {
	    axis = 0;
	  }

	  if (batchDims === void 0) {
	    batchDims = 0;
	  }

	  var $x = convertToTensor(x, 'x', 'gather');
	  var $indices = convertToTensor(indices, 'indices', 'gather', 'int32');
	  var inputs = {
	    x: $x,
	    indices: $indices
	  };
	  var attrs = {
	    axis: axis,
	    batchDims: batchDims
	  };
	  return ENGINE.runKernel(GatherV2, inputs, attrs);
	}
Gather slices from tensor `x`'s axis `axis` according to `indices`.

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

x.gather(indices).print();
```

```js
const x = tf.tensor2d([1, 2, 3, 4], [2, 2]);
const indices = tf.tensor1d([1, 1, 0], 'int32');

x.gather(indices).print();
```
@param x The input tensor whose slices to be gathered.
@param indices The indices of the values to extract.
@param axis The axis over which to select values. Defaults to 0.
@param batchDims Optional. The number of batch dimensions. It must be less
    than or equal to rank(indices). Defaults to 0.
    The output tensor will have shape of
    `x.shape[:axis] + indices.shape[batchDims:] + x.shape[axis + 1:]`

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