pub fn new_for_outputs(model: M, outputs: &[OutletId]) -> TractResult<SimplePlan<TI, M>> {
        let inputs = model.borrow().input_outlets()?.iter().map(|n| n.node).collect::<Vec<usize>>();
        let outputs_nodes = outputs.iter().map(|n| n.node).collect::<Vec<usize>>();
        let order = eval_order_for_nodes(model.borrow().nodes(), &inputs, &outputs_nodes)?;
        let mut values_needed_until_step = vec![0; model.borrow().nodes().len()];
        for step in 0..order.len() {
            for i in &model.borrow().node(order[step]).inputs {
                values_needed_until_step[i.node] = step;
            }
        }
        for o in outputs.iter() {
            values_needed_until_step[o.node] = order.len();
        }
        let mut flush_lists: Vec<TVec<usize>> = vec![tvec!(); order.len() + 1];
        for (node, &flush_at) in values_needed_until_step.iter().enumerate() {
            if flush_at != 0 {
                flush_lists[flush_at].push(node)
            }
        }
        Ok(SimplePlan {
            model,
            order,
            flush_lists,
            outputs: outputs.to_vec(),
            _casper: PhantomData,
        })
    }
/// This contructor returns a plan that will compute all specified outputs in one pass.
This contructor returns a plan that will compute all specified outputs in one pass.
This contructor returns a plan that will compute all specified outputs in one pass .
pub fn new_for_outputs(model: M, outputs: &[OutletId]) -> TractResult<SimplePlan<TI, M>> {
        let inputs = model.borrow().input_outlets()?.iter().map(|n| n.node).collect::<Vec<usize>>();
        let outputs_nodes = outputs.iter().map(|n| n.node).collect::<Vec<usize>>();
        let order = eval_order_for_nodes(model.borrow().nodes(), &inputs, &outputs_nodes)?;
        let mut values_needed_until_step = vec![0; model.borrow().nodes().len()];
        for step in 0..order.len() {
            for i in &model.borrow().node(order[step]).inputs {
                values_needed_until_step[i.node] = step;
            }
        }
        for o in outputs.iter() {
            values_needed_until_step[o.node] = order.len();
        }
        let mut flush_lists: Vec<TVec<usize>> = vec![tvec!(); order.len() + 1];
        for (node, &flush_at) in values_needed_until_step.iter().enumerate() {
            if flush_at != 0 {
                flush_lists[flush_at].push(node)
            }
        }
        Ok(SimplePlan {
            model,
            order,
            flush_lists,
            outputs: outputs.to_vec(),
            _casper: PhantomData,
        })
    }
pub fn new_for_outputs ( model : M , outputs : & [ OutletId ] ) -> TractResult < SimplePlan < TI , M > > { let inputs = model . borrow ( ) . input_outlets ( ) ? . iter ( ) . map ( | n | n . node ) . collect :: < Vec < usize > > ( ) ; let outputs_nodes = outputs . iter ( ) . map ( | n | n . node ) . collect :: < Vec < usize > > ( ) ; let order = eval_order_for_nodes ( model . borrow ( ) . nodes ( ) , & inputs , & outputs_nodes ) ? ; let mut values_needed_until_step = vec ! [ 0 model borrow ( ) nodes ( ) len ( ) ] ; for step in 0 .. order . len ( ) { for i in & model . borrow ( ) . node ( order [ step ] ) . inputs { values_needed_until_step [ i . node ] = step ; } } for o in outputs . iter ( ) { values_needed_until_step [ o . node ] = order . len ( ) ; } let mut flush_lists : Vec < TVec < usize > > = vec ! [ tvec ( ) order len ( ) 1 ] ; for ( node , & flush_at ) in values_needed_until_step . iter ( ) . enumerate ( ) { if flush_at != 0 { flush_lists [ flush_at ] . push ( node ) } } Ok ( SimplePlan { model , order , flush_lists , outputs : outputs . to_vec ( ) , _casper : PhantomData , } ) }
This contructor returns a plan that will compute all specified outputs in one pass.
This contructor returns a plan that will compute all specified outputs in one pass .
model
M
outputs
&[OutletId]
model
M
outputs
&[OutletId]