pub fn immutable_regressor(&mut self, mi: &model_instance::ModelInstance) -> Result<Regressor, Box<dyn Error>> {
        // Only to be used by unit tests 
        let mut rg = self.immutable_regressor_without_weights(&mi)?;
        rg.allocate_and_init_weights(&mi);

        let mut tmp_vec: Vec<u8> = Vec::new();
        for (i, v) in &mut self.blocks_boxes.iter().enumerate() {
            let mut cursor = Cursor::new(&mut tmp_vec);
            v.write_weights_to_buf(&mut cursor)?;
            cursor.set_position(0);
            v.read_weights_from_buf_into_forward_only(&mut cursor, &mut rg.blocks_boxes[i])?;
        }
        Ok(rg)
    }
// Create immutable regressor from current regressor
Create immutable regressor from current regressor
Create immutable regressor from current regressor
pub fn immutable_regressor(&mut self, mi: &model_instance::ModelInstance) -> Result<Regressor, Box<dyn Error>> {
        // Only to be used by unit tests 
        let mut rg = self.immutable_regressor_without_weights(&mi)?;
        rg.allocate_and_init_weights(&mi);
        let mut tmp_vec: Vec<u8> = Vec::new();
        for (i, v) in &mut self.blocks_boxes.iter().enumerate() {
            let mut cursor = Cursor::new(&mut tmp_vec);
            v.write_weights_to_buf(&mut cursor)?;
            cursor.set_position(0);
            v.read_weights_from_buf_into_forward_only(&mut cursor, &mut rg.blocks_boxes[i])?;
        }
        Ok(rg)
    }
pub fn immutable_regressor ( & mut self , mi : & model_instance :: ModelInstance ) -> Result < Regressor , Box < dyn Error > > { // Only to be used by unit tests  let mut rg = self . immutable_regressor_without_weights ( & mi ) ? ; rg . allocate_and_init_weights ( & mi ) ; let mut tmp_vec : Vec < u8 > = Vec :: new ( ) ; for ( i , v ) in & mut self . blocks_boxes . iter ( ) . enumerate ( ) { let mut cursor = Cursor :: new ( & mut tmp_vec ) ; v . write_weights_to_buf ( & mut cursor ) ? ; cursor . set_position ( 0 ) ; v . read_weights_from_buf_into_forward_only ( & mut cursor , & mut rg . blocks_boxes [ i ] ) ? ; } Ok ( rg ) }
Create immutable regressor from current regressor
Create immutable regressor from current regressor
&mut self
mi
&model_instance::ModelInstance
&mut self
mi
&model_instance::ModelInstance