Skip to main content

topological_sort

Function topological_sort 

Source
pub fn topological_sort(graph: &EinsumGraph) -> Option<Vec<usize>>
Expand description

Perform topological sort on the computation graph.

Returns a linearization of tensors such that if there’s a dependency from A to B, A appears before B in the ordering. Returns None if the graph contains cycles.