Creates a tf.Tensor with all elements set to 1.
tf.Tensor
tf.ones([2, 2]).print(); Copy
tf.ones([2, 2]).print();
An array of integers defining the output tensor shape.
Optional
The type of an element in the resulting tensor. Defaults to 'float'.
Generated using TypeDoc
Creates a
tf.Tensor
with all elements set to 1.