code: def unstack_sequence_fields(
      struct: ElementType, batch_size: int
  ) -> List[ElementType]:
      """Converts a struct of batched arrays to a list of structs.
  
      This is effectively the inverse of `stack_sequence_fields`.
  
      Args:
        struct: An (arbitrarily nested) structure of arrays.
        batch_size: The length of the leading dimension of each array in the struct.
          This is assumed to be static and known.
  
      Returns:
        A list of structs with the same structure as `struct`, where each leaf node
         is an unbatched element of the original leaf node.
      """
  
      return [
          tree.map_structure(lambda s, i=i: s[i], struct)
          for i in range(batch_size)
      ]
  
file_path: acme/acme/utils/tree_utils.py
imports: from typing import Sequence, List, TypeVar, Any
  import numpy
  import tree
label_desc: Use image node_id 4 for calling a global function with example usage: unstack_sequence_fields(struct, batch_size) and returns: unknown