-
Notifications
You must be signed in to change notification settings - Fork 345
mxtensor: support clone #3070
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
mxtensor: support clone #3070
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/3070
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
memory_format = kwargs.get("memory_format", None) | ||
|
||
if memory_format is not None: | ||
clone_fn = lambda x: x.clone(memory_format=memory_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.
Why not just avoid the if statement with clone_fn = lambda x: x.clone(**kwargs)
? Do we need to explicitly exclude other kwargs and only include memory format if specified, for some reason?
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.
this is copy-pasta from
def nvfp4_clone(func, types, args, kwargs): |
Summary:
This is needed for saving HF models with mxfp4 weights to disk.
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags: