Solved by tom in post #2 
              
              
                No, you would need to do x * y if condition else x (if short circuits, so x * y will not be evaluated if the condition is false). 
Experiments: 
Multiplication is not a no-op 
x = torch.randn(12)
y = x * 1
print(x.data_ptr(), y.data_ptr())

if short-circuits: 
x = []
print(x[1] if len(x) > 0 else No…