tf_agents.utils.nest_utils.split_nested_tensors
Stay organized with collections
Save and categorize content based on your preferences.
Split batched nested tensors, on batch dim (outer dim), into a list.
tf_agents.utils.nest_utils.split_nested_tensors(
tensors, specs, num_or_size_splits
)
Args |
tensors
|
Nested list/tuple or dict of batched Tensors.
|
specs
|
Nested list/tuple or dict of TensorSpecs, describing the shape of the
non-batched Tensors.
|
num_or_size_splits
|
Same as argument for tf.split. Either a python integer
indicating the number of splits along batch_dim or a list of integer
Tensors containing the sizes of each output tensor along batch_dim. If a
scalar then it must evenly divide value.shape[axis]; otherwise the sum of
sizes along the split dimension must match that of the value. For
SparseTensor inputs, num_or_size_splits must be the scalar num_split
(see documentation of tf.sparse.split for more details).
|
Returns |
A list of nested non-batched version of each tensor, where each list item
corresponds to one batch item.
|
Raises |
ValueError
|
if the tensors and specs have incompatible dimensions or shapes.
|
ValueError
|
if a non-scalar is passed and there are SparseTensors in the
structure.
|
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."],[],[]]