Skip to content

Commit

Permalink
Added num_residuals abstract method to residual fns
Browse files Browse the repository at this point in the history
  • Loading branch information
edyounis committed Aug 5, 2024
1 parent 200e799 commit c9fd5af
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bqskit/ir/opt/cost/residual.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class ResidualsFunction(CostFunction):
def get_residuals(self, params: RealVector) -> npt.NDArray[np.float64]:
"""Return the vector of residuals given the input parameters."""

@abc.abstractmethod
def num_residuals(self) -> int:
"""Return the number of residuals, should be nonnegative."""

def __call__( # type: ignore
self,
params: RealVector,
Expand Down

0 comments on commit c9fd5af

Please sign in to comment.