tfp.experimental.distributions.marginal_fns.ps.cond
Stay organized with collections
Save and categorize content based on your preferences.
Return either true_fn()
if predicate pred
is true else false_fn()
.
tfp.experimental.distributions.marginal_fns.ps.cond(
pred, true_fn=None, false_fn=None, name=None
)
If pred
is a bool or has a constant value, we return either true_fn()
or false_fn()
, otherwise we use tf.cond
to dynamically route to both.
Args |
pred
|
A scalar determining whether to return the result of true_fn or
false_fn .
|
true_fn
|
The callable to be performed if pred is true.
|
false_fn
|
The callable to be performed if pred is false.
|
name
|
Optional name prefix when using tf.cond .
|
Returns |
Tensors returned by the call to either true_fn or false_fn .
|
Raises |
TypeError
|
If true_fn or false_fn 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."],[],[]]