[newbie] how to copy the value of torch::Tensor to another torch::Tensor

this code:

torch::Tensor t0 = torch::zeros(1);
torch::Tensor t1 = torch::ones(1);
t1 = t0.detach().clone();

std::cout << (t1 == t0).item<bool>() << std::endl;

outputs: 1
Doesn’t it mean it works ?