Unstack/unbatch a nest of numpy arrays into flat items.
tf_agents.utils.nest_utils.unstack_nested_arrays_into_flat_items(
nested_array
)
Rebuild the nested structure of the unbatched elements is expensive. On the
other hand it is sometimes unnecessary (e.g. if the downstream processing
requires flattened structure, e.g. some replay buffer writers which flattens
the items anyway).
Args |
nested_array
|
Nest of numpy arrays where each array has shape [batch_size,
...].
|
Returns |
A list of length batch_size where each item in the list is the flattened
version of the corresponding item of the input.
|