giagrad.Tensor.ones#

Tensor.ones() Tensor[source]#

Fills tensor data with ones.

Examples

>>> Tensor.empty(2, 3).ones()
tensor: [[1. 1. 1.]
         [1. 1. 1.]]
>>> Tensor([1, 3, 4, 5]).ones()
tensor: [1., 1., 1., 1.]