PyMC3 elementwise if condition

Those should definitely work with TensorVariables. Can you show the complete code, including the creation of Phi?