Solved by spanev in post #2 
              
              
                Hi @numbpy, 
Maybe something as this would work for you: 
torch.where((input > x), input, torch.zeros_like(input))

Please find more about torch.where here.