tfp.experimental.distributions.marginal_fns.ps.case
Stay organized with collections
Save and categorize content based on your preferences.
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.
Args |
pred_fn_pairs
|
Dict or list of pairs of a boolean scalar tensor and a
callable which returns a list of tensors.
|
default
|
Optional callable that returns a list of tensors.
|
exclusive
|
True iff at most one predicate is allowed to evaluate to True .
|
name
|
A name for this operation (optional).
|
Returns |
The tensors returned by the first pair whose predicate evaluated to True, or
those returned by default if none does.
|
Raises |
TypeError
|
If pred_fn_pairs is not a list/dictionary.
|
TypeError
|
If pred_fn_pairs is a list but does not contain 2-tuples.
|
TypeError
|
If fns[i] is not callable for any i, or default is not
callable.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-11-21 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-11-21 UTC."],[],[]]