[ATen] How to replace all the zero values in a tensor to one

In Python we could do this tensor[tensor==0] = 1
How to this operation with at::Tensor in C++??