View source on GitHub |
Return a new tensor of given shape and type, filled with ones.
tf.keras.ops.ones(
shape, dtype=None
)
Args | |
---|---|
shape
|
Shape of the new tensor. |
dtype
|
Desired data type of the tensor. |
Returns | |
---|---|
Tensor of ones with the given shape and dtype. |