Repository navigation
Conversation
Contributor
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.
procrustes_naiveflattens the batch dimensions ofMbefore the SVD and restores them forR. Withreturn_singular_values=True, it returns the singular valuesDSwith the flattened shape.procrustesrestores the batch dimensions of both outputs, so the two functions disagree wheneverMdoes not have exactly one batch dimension:M.shape == (3, 3):procrustesreturnsDSof shape(3,),procrustes_naivereturns(1, 3).M.shape == (2, 5, 3, 3):procrustesreturns(2, 5, 3),procrustes_naivereturns(10, 3).special_procrustes_naivecallsprocrustes_naiveand has the same issue.Restore the batch dimensions of
DSwithroma.internal.unflatten_batch_dims, asprocrustesdoes. The new test runsprocrustes_naiveon inputs with zero, one and two batch dimensions, with and withoutforce_rotation, checks the shapes ofRandDS, and compares both outputs withprocrustes.Validation on current master
9b168674896f2b586cb8addb4fbc9ed69f1e7df4, CPU:torch.Size([1, 3]) != (3,)) and passes with the fix.python -m unittest: all 72 tests pass with CPython 3.12.12, PyTorch 2.14.1 and NumPy 2.5.4. The suite also passes with the two older CI configurations, CPython 3.12.12 / PyTorch 2.3.1 / NumPy 1.26.4 and CPython 3.11.14 / PyTorch 2.0.1 / NumPy 1.26.4, wheretest_jvp_torch_compileis skipped by its existing version check.roma,testandexamplespass.git diff --checkpasses.CUDA was not run locally.