Creates a tf.Tensor with all elements set to 1 with the same shape as the given tensor.
tf.Tensor
const x = tf.tensor([1, 2]);tf.onesLike(x).print(); Copy
const x = tf.tensor([1, 2]);tf.onesLike(x).print();
A tensor.
Generated using TypeDoc
Creates a
tf.Tensor
with all elements set to 1 with the same shape as the given tensor.