function pad_(x, paddings, constantValue) {
	  if (constantValue === void 0) {
	    constantValue = 0;
	  }

	  var $x = convertToTensor(x, 'x', 'pad');

	  if ($x.rank === 0) {
	    throw new Error('pad(scalar) is not defined. Pass non-scalar to pad');
	  }

	  var attrs = {
	    paddings: paddings,
	    constantValue: constantValue
	  };
	  var inputs = {
	    x: $x
	  };
	  return ENGINE.runKernel(PadV2, inputs, attrs);
	}
Pads a `tf.Tensor` with a given value and paddings.

This operation implements `CONSTANT` mode. For `REFLECT` and `SYMMETRIC`,
refer to `tf.mirrorPad`

Also available are stricter rank-specific methods with the same signature
as this method that assert that `paddings` is of given length.
  - `tf.pad1d`
  - `tf.pad2d`
  - `tf.pad3d`
  - `tf.pad4d`

```js
const x = tf.tensor1d([1, 2, 3, 4]);
x.pad([[1, 2]]).print();
```
@param x The tensor to pad.
@param paddings An array of length `R` (the rank of the tensor), where
each element is a length-2 tuple of ints `[padBefore, padAfter]`,
specifying how much to pad along each dimension of the tensor.
@param constantValue The pad value to use. Defaults to 0.

@doc {heading: 'Tensors', subheading: 'Transformations'}