fix(metrics): correct compute() return values to prevent ValueError crash#538
fix(metrics): correct compute() return values to prevent ValueError crash#538Aamod-Dev wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Aamod007 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @Aamod007! It looks like this is your first PR to kubeedge/ianvs 🎉 |
There was a problem hiding this comment.
Code Review
This pull request updates the compute function in core/testcasecontroller/metrics/metrics.py to return a 3-tuple (None, np.nan, np.nan) instead of a 2-tuple of np.nan values when the flag condition is not met. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/assign @MooreZheng |
…rash Signed-off-by: Aamod007 <aamodkumar2006@gmail.com>
c66359a to
020eb32
Compare
|
/assign @jaypume |
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR fixes a bug in
core/testcasecontroller/metrics/metrics.pythat causes aValueError: not enough values to unpack (expected 3, got 2)when running lifelong learning or incremental learning benchmarks with a malformed (non-square) task matrix.Previously, when the
compute()function detected a malformed matrix (flag=False), it returned a 2-tuple:(bwt_score, fwt_score). However, all callers of this function (e.g.bwt_func,fwt_func,matrix_func) unconditionally expect a 3-tuple (_, BWT_score, _ = compute(...)), resulting in an immediate crash.This commit updates the error path of
compute()to consistently return a 3-tuple(None, np.nan, np.nan)whenflag=False, satisfying caller expectations.Which issue(s) this PR fixes:
Fixes #531
Special notes for your reviewer:
N/A