View source on GitHub |
Like tf.case, except attempts to statically evaluate predicates.
tfp.experimental.distributions.marginal_fns.ps.case(
pred_fn_pairs, default=None, exclusive=False, name='smart_case'
)
If any predicate in pred_fn_pairs
is a bool or has a constant value, the
associated callable will be called or omitted depending on its value.
Otherwise this functions like tf.case.
Returns | |
---|---|
The tensors returned by the first pair whose predicate evaluated to True, or
those returned by default if none does.
|