Make sorted_nodes pub function (#2780)

This commit is contained in:
Liang-Chi Hsieh
2025-02-22 01:23:45 -08:00
committed by GitHub
parent 9e8bf70333
commit 26c16923b9

View File

@ -32,7 +32,7 @@ impl Tensor {
/// elements having dependencies on the latter ones, e.g. the first element if any is the
/// argument.
/// This assumes that the op graph is a DAG.
fn sorted_nodes(&self) -> Vec<&Tensor> {
pub fn sorted_nodes(&self) -> Vec<&Tensor> {
// The vec of sorted nodes is passed as an owned value rather than a mutable reference
// to get around some lifetime limitations.
fn walk<'a>(