Repository navigation
Fix standard deviation in PyTorch array summaries - #81
Closed
Linxiushen wants to merge 1 commit into
Closed
Linxiushen wants to merge 1 commit into
Linxiushen wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Linxiushen
force-pushed
the
fix/torch-summary-standard-deviation
branch
from
September 28, 2026 03:51
825cbd2 to
dceaefe
Compare
Collaborator
|
Closing this PR since the contributions appear to be automated and unrelated to real-world use of this library. |
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.
PyTorch floating-point summaries currently display the variance after
±, while NumPy and JAX display the population standard deviation. For example,[1.0, 5.0]is summarized as≈3.0 ±4.0instead of≈3.0 ±2.0.Take the square root of the existing finite-value variance, keeping the current NaN/infinity filtering. Exercise both values of
fastin the existing backend-consistency test (it previously passedfast=Truetwice), cover singleton and non-finite inputs across all three backends, and update the affected rendering expectations.Validation on Python 3.11 / Windows, NumPy 2.2.6, JAX 0.6.2 and PyTorch 2.7.1:
±4.0versus±2.0and the existing large-array consistency check catches variance versus standard deviation.python -m pytest tests/ndarray_adapters_test.py -q --tb=short— 28 passed, 96 subtests passed.test_closure_renderingfails identically on unchanged main (173 passed, 1 skipped, same failure).pyink treescope tests --check(24.8.0) andpylint treescope(3.3.1) pass. Linux CI / pytype and GPU execution were not run locally.