Changing specific elements in tensor

I’m looking for some function or any efficient way to change specific elements in a tensor.
Let’s say for example that I need to add 100 only for elements that are bigger than 5, and the other elements should stay the same.
Does anyone know how can I do it efficiently?
Thank you.

if x is your tensor
you can do:

torch.where(x > 5, x+100, x)

Thank you for your comment (: