compositional_graph_models/data.py
def tree_depth(tree: dgl.DGLGraph) -> int:
    """
    Compute the maximum distance from a leaf to the root.
    """
    return len(dgl.topological_nodes_generator(tree)) - 1

    Compute the maximum distance from a leaf to the root.
    
Compute the maximum distance from a leaf to the root.
Compute the maximum distance from a leaf to the root .
def tree_depth(tree: dgl.DGLGraph) -> int:
    return len(dgl.topological_nodes_generator(tree)) - 1
def tree_depth ( tree : dgl . DGLGraph ) -> int : return len ( dgl . topological_nodes_generator ( tree ) ) - 1
Compute the maximum distance from a leaf to the root.
Compute the maximum distance from a leaf to the root .
"""
    Compute the maximum distance from a leaf to the root.
    """
tree
dgl.DGLGraph