tf.keras.ops.ones

Return a new tensor of given shape and type, filled with ones.

Main aliases

tf.keras.ops.numpy.ones

shape Shape of the new tensor.
dtype Desired data type of the tensor.

Tensor of ones with the given shape and dtype.