tree_block_until_ready#
- t3toolbox.backend.common.tree_block_until_ready(tree)#
def tree_block_until_ready( tree: typ.Any, # any pytree: jax / numpy arrays, Python scalars, None, registered dataclasses ) -> None:
Wait until every jax array in
treeis computed:jax.block_until_ready(tree)when a leaf is a jax array; otherwise nothing (numpy is synchronous). jax dispatches asynchronously, so a host clock read right after a jax call measures the dispatch, not the work; a timer calls this at its boundaries. Eager only: a traced leaf has nothing to wait for.- Parameters:
tree (Any)
- Return type:
None