Fix bug in permute function and fix a type. - #28
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #28 +/- ##
=======================================
Coverage 38.57% 38.57%
=======================================
Files 3 3
Lines 197 197
Branches 26 26
=======================================
Hits 76 76
Misses 121 121 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in the permutation function and corrects a typo in a method name. The changes address issues with tensor dimension handling and naming consistency.
- Fixes tensor dimension mismatch in the permute function by properly unsqueezing parity tensors
- Corrects typo in method name from
_unqueezeto_unsqueeze - Updates all references to use the corrected method name
| torch.logical_xor, | ||
| ( | ||
| torch.logical_and(parity[i], parity[j]) | ||
| torch.logical_and(self._unsqueeze(parity[i], i, self.tensor.dim()), self._unsqueeze(parity[j], j, self.tensor.dim())) |
There was a problem hiding this comment.
The variable parity is not defined in this scope. Based on the context, it appears this should be self.parity to access the parity property of the class instance.
Suggested change
| torch.logical_and(self._unsqueeze(parity[i], i, self.tensor.dim()), self._unsqueeze(parity[j], j, self.tensor.dim())) | |
| torch.logical_and(self._unsqueeze(self.parity[i], i, self.tensor.dim()), self._unsqueeze(self.parity[j], j, self.tensor.dim())) |
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.
No description provided.