Solved by ptrblck in post #7 
              
              
                Thanks for the example. 
Let’s call the first tensor input, the second output and the last theta. 
Would the following work: 
threshold = 0.26
idx = theta > threshold
input_filt = input[idx]
output_filt = output[idx]

If you want to keep the negation, you could use: 
input_filt = input[~idx]
output_…