function onesLike_(x) {
    const $x = (0, _tensorUtilEnv.convertToTensor)(x, "x", "onesLike");
    const inputs = {
        x: $x
    };
    return (0, _engine.ENGINE).runKernel((0, _kernelNames.OnesLike), inputs);
}
Creates a `tf.Tensor` with all elements set to 1 with the same shape as the
given tensor.

```js
const x = tf.tensor([1, 2]);
tf.onesLike(x).print();
```
@param x A tensor.

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