-
Notifications
You must be signed in to change notification settings - Fork 169
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
Fix affine quantized tensor to device calls #726
Conversation
Summary: Fixes: pytorch#698 Also added `TorchAOBaseTensor` addressing part of pytorch#710 Test Plan: python test/dtypes/test_affine_quantized.py Reviewers: Subscribers: Tasks: Tags:
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/726
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit f2e4a39 with merge base ac8ce4c (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
torchao/utils.py
Outdated
memory_format = ( | ||
memory_format if memory_format is not None else torch.preserve_format | ||
) |
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.
I have wondered about this for some time. Does it make sense to have memory_format
applied to inner tensor? From what I understand, it's mainly for channels_last in convolution (https://pytorch.org/docs/stable/tensor_attributes.html#torch-memory-format). Maybe we can skip memory_format
argument also?
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.
yeah this probably does not apply for most of the tensors, it won't impact things much if we remove this as well I think.
I guess if in the future some special cases need these args we can just copy paste this function and add the ommitted args
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.
if the current tests pass, I think should be good for now!
Summary:
Fixes: #698
Also added
TorchAOBaseTensor
addressing part of #710Test Plan:
python test/dtypes/test_affine_quantized.py
Reviewers:
Subscribers:
Tasks:
Tags: