-
Notifications
You must be signed in to change notification settings - Fork 26.3k
fixes printing non-contiguous tensors #10405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Link to issue: #10402 |
|
Can we get a test? |
|
@ezyang Do you mean a specific test in import torch
import torch.nn as nn
batch_size = 10
channels = 3
h, w = 16, 16
x = torch.randn(batch_size, channels, h, w)
pool = nn.AvgPool2d((1, 2), (1, 2))
output = pool(x)
output = output.view(batch_size, channels, h//2, 2, w//2)
print(output.select(3, 1).mul_(-1))doesn't throw an error in the last line. If the former, sure, where should I add it? |
torch/_tensor_str.py
Outdated
| else: | ||
| return self | ||
| if self.size(0) > 2 * PRINT_OPTS.edgeitems: | ||
| self = self.contiguous() |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
@ptrblck For test, you can manually create a tensor and use |
colesbury
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
colesbury has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
soumith is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: Pull Request resolved: pytorch#10405 Differential Revision: D9302794 Pulled By: soumith fbshipit-source-id: e4a7db8d33400a5a050d05fd1679de8bc3cbcf30
No description provided.