pub fn declutter(self) -> TractResult<TypedModel> {
        let mut model = self;
        let model_inputs = model.input_outlets()?.len();
        let model_outputs = model.output_outlets()?.len();
        loop {
            let mut done_something = false;
            for p in crate::optim::declutter() {
                done_something = done_something || p.pass(&mut model)?;
                if cfg!(debug_assertions) {
                    model.check_edges()?;
                    assert_eq!(model.input_outlets()?.len(), model_inputs);
                    assert_eq!(model.output_outlets()?.len(), model_outputs);
                }
            }
            if !done_something {
                break;
            }
            model = compact::compact(&model)?;
        }
        Ok(model)
    }
/// Perform declutter pass on the network.
Perform declutter pass on the network.
Perform declutter pass on the network .
pub fn declutter(self) -> TractResult<TypedModel> {
        let mut model = self;
        let model_inputs = model.input_outlets()?.len();
        let model_outputs = model.output_outlets()?.len();
        loop {
            let mut done_something = false;
            for p in crate::optim::declutter() {
                done_something = done_something || p.pass(&mut model)?;
                if cfg!(debug_assertions) {
                    model.check_edges()?;
                    assert_eq!(model.input_outlets()?.len(), model_inputs);
                    assert_eq!(model.output_outlets()?.len(), model_outputs);
                }
            }
            if !done_something {
                break;
            }
            model = compact::compact(&model)?;
        }
        Ok(model)
    }
pub fn declutter ( self ) -> TractResult < TypedModel > { let mut model = self ; let model_inputs = model . input_outlets ( ) ? . len ( ) ; let model_outputs = model . output_outlets ( ) ? . len ( ) ; loop { let mut done_something = false ; for p in crate :: optim :: declutter ( ) { done_something = done_something || p . pass ( & mut model ) ? ; if cfg ! ( debug_assertions ) { model . check_edges ( ) ? ; assert_eq ! ( model input_outlets ( ) len ( ) model_inputs ) ; assert_eq ! ( model output_outlets ( ) len ( ) model_outputs ) ; } } if ! done_something { break ; } model = compact :: compact ( & model ) ? ; } Ok ( model ) }
Perform declutter pass on the network.
Perform declutter pass on the network .
self