Repository navigation
Simplify metric computations and test assertions in Metrax. - #169
Merged
Merged
Conversation
copybara-service
Bot
force-pushed
the
test_1023182283
branch
2 times, most recently
from
November 20, 2026 00:30
c55525f to
8d9cd8b
Compare
- Combine duplicate `rtol` and `atol` tolerance definitions into `atol = rtol = ...` across `base_test.py`, `classification_metrics_test.py`, `regression_metrics_test.py`, and `nnx_wrapper_test.py`. - Remove redundant `y_pred = y_pred.astype(y_true.dtype)` casts in `regression_metrics_test.py` and `nnx_wrapper_test.py`. - Simplify binary threshold comparisons in `Precision`, `Recall`, and `FBetaScore` (`classification_metrics.py`). - Vectorize `BLEU.compute` and `RougeBase.compute` in `nlp_metrics.py`. - Delegate `MAE`, `MSE`, and `MSLE` `from_model_output` to `super().from_model_output` in `regression_metrics.py`. - `base.Average.from_model_output` now counts in `int32` instead of the input dtype, fixing bfloat16/float16 count accumulation on long evaluations across Average-based metrics (SSIM, IoU, PSNR, CosineSimilarity, SNR, etc.). PiperOrigin-RevId: 1025997965
copybara-service
Bot
force-pushed
the
test_1023182283
branch
from
November 20, 2026 00:35
8d9cd8b to
501a9f4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Simplify metric computations and test assertions in Metrax.
rtolandatoltolerance definitions intoatol = rtol = ...acrossbase_test.py,classification_metrics_test.py,regression_metrics_test.py, andnnx_wrapper_test.py.y_pred = y_pred.astype(y_true.dtype)casts inregression_metrics_test.pyandnnx_wrapper_test.py.Precision,Recall, andFBetaScore(classification_metrics.py).BLEU.computeandRougeBase.computeinnlp_metrics.py.MAE,MSE, andMSLEfrom_model_outputtosuper().from_model_outputinregression_metrics.py.base.Average.from_model_outputnow counts inint32instead of the input dtype, fixing bfloat16/float16 count accumulation on long evaluations across Average-based metrics (SSIM, IoU, PSNR, CosineSimilarity, SNR, etc.).