pymc.math.where#

pymc.math.where(condition[, ift, iff])[source]#

Return elements chosen from ift or iff depending on condition.

Note: When only condition is provided, this function is a shorthand for as_tensor(condition).nonzero().

Parameters:
conditiontensor_like, bool

Where True, yield ift, otherwise yield iff.

x, ytensor_like

Values from which to choose.

Returns:
outTensorVariable

A tensor with elements from ift where condition is True, and elements from iff elsewhere.