tf_agents.utils.nest_utils.where
Stay organized with collections
Save and categorize content based on your preferences.
Generalization of tf.where for nested structures.
tf_agents.utils.nest_utils.where(
condition, true_outputs, false_outputs
)
This generalization handles applying where across nested structures and the
special case where the rank of the condition is smaller than the rank of the
true and false cases.
Args |
condition
|
A boolean Tensor of shape [B, ...]. The shape of condition must
be equal to or a prefix of the shape of true_outputs and false_outputs. If
condition's rank is smaller than the rank of true_outputs and
false_outputs, dimensions of size 1 are added to condition to make its
rank match that of true_outputs and false_outputs in order to satisfy the
requirements of tf.where.
|
true_outputs
|
Tensor or nested tuple of Tensors of any dtype, each with
shape [B, ...], to be split based on condition .
|
false_outputs
|
Tensor or nested tuple of Tensors of any dtype, each with
shape [B, ...], to be split based on condition .
|
Returns |
Interleaved output from true_outputs and false_outputs based on
condition .
|
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 2024-04-26 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 2024-04-26 UTC."],[],[]]