Solved by ptrblck in post #2 
              
              
                torch.where should work: 
mytensor = torch.tensor([10, 20, 30, 40])
mythreshold = torch.tensor([2, 50, 25, 100])

torch.where(mytensor < mythreshold, mythreshold, mytensor)
> tensor([10, 50, 30, 100])