optax.tree_utils.tree_size

Contents

optax.tree_utils.tree_size#

optax.tree_utils.tree_size(tree: Any) int[source]#

Total size of a pytree.

Parameters:

tree โ€“ pytree

Returns:

the total size of the pytree.