bartz.grove.tree_depth

bartz.grove.tree_depth(tree)[source]

Return the maximum depth of a tree.

Parameters:

tree (Shaped[Array, '*batch_shape tree_size']) – A tree array like those in a TreeHeaps. If the array is ND, the tree structure is assumed to be along the last axis.

Returns:

intThe maximum depth of the tree.