Sorry, in my previous post, the variable some_condition is actually a tensor of conditions, like (tensorA > tensorB).
And, the code I used is actually:
some_condition = some_condition.type(torch.LongTensor)
out_tensor1 = some_condition * some_tensor1 + (1-some_condition) * some_tensor2

and, similarly for out_tensor 2 and 3. I couldn’t find a function which would perform the operation for all 3 out_tensors at once. Anyways it’s working now, thanks.