Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix masked_fill_ bug on non-contiguous tensor#12594

Closed
mingfeima wants to merge 2 commits into
pytorch:masterfrom
mingfeima:fix_masked_fill
Closed

fix masked_fill_ bug on non-contiguous tensor#12594
mingfeima wants to merge 2 commits into
pytorch:masterfrom
mingfeima:fix_masked_fill

Conversation

@mingfeima
Copy link
Copy Markdown
Collaborator

bug fix on #12230 , the following script pass after the fix.

x = torch.randn(2, 2, 2)
x = x.permute((2, 0, 1))
y = x.clone()
y.masked_fill_(y > 0, 1)
x.masked_fill_(x > 0, 1)
print((x == y).all())

@mingfeima
Copy link
Copy Markdown
Collaborator Author

@ezyang hi, the circleci related fail doesn't see to be related to the PR. Please take a look.

@ezyang
Copy link
Copy Markdown
Contributor

ezyang commented Oct 12, 2018

Can you add that test to the test suite, in this patch?

Copy link
Copy Markdown
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But needs a test.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

soumith has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

zdevito pushed a commit to zdevito/ATen that referenced this pull request Oct 15, 2018
Summary:
bug fix on #12230 , the following script pass after the fix.
```python
x = torch.randn(2, 2, 2)
x = x.permute((2, 0, 1))
y = x.clone()
y.masked_fill_(y > 0, 1)
x.masked_fill_(x > 0, 1)
print((x == y).all())
```
Pull Request resolved: pytorch/pytorch#12594

Differential Revision: D10377088

Pulled By: soumith

fbshipit-source-id: 88feabe1459d325bfdf9a860412ddbd28686a28b
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
bug fix on pytorch#12230 , the following script pass after the fix.
```python
x = torch.randn(2, 2, 2)
x = x.permute((2, 0, 1))
y = x.clone()
y.masked_fill_(y > 0, 1)
x.masked_fill_(x > 0, 1)
print((x == y).all())
```
Pull Request resolved: pytorch#12594

Differential Revision: D10377088

Pulled By: soumith

fbshipit-source-id: 88feabe1459d325bfdf9a860412ddbd28686a28b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants