[null,null,["Last updated 2023-11-21 UTC."],[],[],null,["# tfp.experimental.distributions.marginal_fns.ps.smart_where\n\n\u003cbr /\u003e\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/probability/blob/v0.23.0/tensorflow_probability/python/internal/prefer_static.py#L141-L172) |\n\nAs tf.where, but only calls x_fn/y_fn when condition not statically known. \n\n tfp.experimental.distributions.marginal_fns.ps.smart_where(\n condition, x_fn, y_fn\n )\n\n| **Important:** Since this avoids executing the inoperative branch when possible, it will not necessarily broadcast `x_fn()` with `y_fn()`, so it is imperative that they return `Tensor`s which broadcast with `condition` to the same final shape.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-------------|------------------------------------------------------------------------------|\n| `condition` | A `bool` Tensor. |\n| `x_fn` | A callable returning a `Tensor`, for locations where `condition` is `True`. |\n| `y_fn` | A callable returning a `Tensor`, for locations where `condition` is `False`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A `Tensor` equivalent to `tf.where(condition, x_fn(), y_fn())`. ||\n\n\u003cbr /\u003e"]]