treeflow.traversal.ratio_transform module
- treeflow.traversal.ratio_transform.move_outside_axis_to_inside(x)
- treeflow.traversal.ratio_transform.ratios_to_node_heights(topology: TensorflowTreeTopology, ratios: Tensor, anchor_heights: Tensor, unroll: bool | str = 'auto')
Node-height ratio transform, on the generic
preorder_traversal.The node axis of
ratios/anchor_heightsis the last axis, indexed by internal-node id.- unroll
Forwarded to
preorder_traversal():"auto"unrolls when the topology is statically known (it is whentopologyis a constant/eager object, even captured inside atf.function),Trueforces it (raising otherwise),Falsekeeps the dynamictf.while_loop.