tf_agents.utils.nest_utils.unstack_nested_arrays_into_flat_items

Unstack/unbatch a nest of numpy arrays into flat items.

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).

nested_array Nest of numpy arrays where each array has shape [batch_size, ...].

A list of length batch_size where each item in the list is the flattened version of the corresponding item of the input.