Tensor.ones_like()
Creates a tensor with all elements set to 1 with the same shape, dtype, and device as the input tensor.
Usage
from tinygrad.tensor import Tensor
tensor = Tensor([[1, 2], [3, 4]])
x = Tensor.ones_like(tensor)
print(x.numpy())
Return value
[[1. 1.]
[1. 1.]]