Skip to content

Conversation

gs-olive
Copy link
Collaborator

@gs-olive gs-olive commented Oct 8, 2022

Description

Fixes bug where torch.var only supported single-dimension reductions when unbiased=True. Applied fix by changing how the bias correction is applied and avoiding the use of aten::select

Fixes #1182

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • [ x ] My code follows the style guidelines of this project (You can use the linters)
  • [ x ] I have performed a self-review of my own code
  • [ ] I have commented my code, particularly in hard-to-understand areas and hacks
  • [ ] I have made corresponding changes to the documentation
  • [ x ] I have added tests to verify my fix or my feature
  • [ x ] New and existing unit tests pass locally with my changes
  • [ x ] I have added the relevant labels to my PR in so that relevant reviewers are notified

- Refactor IR code to avoid the use of select, for which only
single-dimension support exists currently
- Update formula in Bessel's correction (unbiased) case
- Include regression tests to catch multi-dimensional indexing errors
@github-actions github-actions bot added component: core Issues re: The core compiler component: lowering Issues re: The lowering / preprocessing passes component: tests Issues re: Tests labels Oct 8, 2022
@gs-olive gs-olive changed the title fix: torch.std and torch.var support multi-dimensional reductions without erroring out fix: torch.std and torch.var support multi-dimensional reductions Oct 8, 2022
@narendasan narendasan marked this pull request as ready for review October 11, 2022 00:56
@narendasan narendasan merged commit 6bef925 into pytorch:master Oct 12, 2022
@gs-olive gs-olive deleted the multi_dim_var_bugfix branch October 12, 2022 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed component: core Issues re: The core compiler component: lowering Issues re: The lowering / preprocessing passes component: tests Issues re: Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 [Bug] torch.Tensor.std doesn't support multiple dimensions
3 participants