Skip to content

Commit

Permalink
Added num_residuals to python interface
Browse files Browse the repository at this point in the history
  • Loading branch information
edyounis committed Aug 5, 2024
1 parent 89c3655 commit 4dd662e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/python/minimizers/residual_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ impl PyHilberSchmidtResidualFn {
self.cost_fn.get_residuals(&params)
}

pub fn num_residuals(&self, _py: Python) -> usize {
self.cost_fn.num_residuals()
}

pub fn get_grad(&self, py: Python, params: Vec<f64>) -> Py<PyArray2<f64>> {
PyArray2::from_array(py, &self.cost_fn.get_grad(&params)).to_owned()
}
Expand Down

0 comments on commit 4dd662e

Please sign in to comment.