Equivalent of select statement

Hi I am Coming here from tensorflow land!

Is there an equivalent of tf.select in pytorch?

I can potentially change the computation graph structure, but I feel that would be much slower than using something like tf.select

Thanks

In Pytorch you can just use an if statement or apply indices like in numpy. Could you provide a small code snippet?