Accept memory_format kwarg on rand/randn/randint _like ops - #3011
Merged
Justin Chu (justinchuby) merged 1 commit intoAug 25, 2026
Merged
Conversation
Justin Chu (justinchuby)
approved these changes
Aug 24, 2026
Collaborator
|
Could you resolve merge conflicts? Thanks |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3011 +/- ##
=======================================
Coverage 72.63% 72.63%
=======================================
Files 265 265
Lines 32218 32218
Branches 3044 3044
=======================================
Hits 23403 23403
Misses 7781 7781
Partials 1034 1034 ☔ View full report in Codecov by Harness. |
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
fruet (gabrielfruet)
force-pushed
the
fix/rand-like-memory-format
branch
from
August 24, 2026 18:38
0417850 to
1bb8ef4
Compare
Contributor
Author
|
Justin Chu (@justinchuby) Conflicts are resolved! Thank you for approving :) It still needs a re-approval since I pushed again |
Justin Chu (justinchuby)
approved these changes
Aug 25, 2026
Justin Chu (justinchuby)
enabled auto-merge (squash)
August 25, 2026 05:45
Justin Chu (justinchuby)
merged commit Aug 25, 2026
7aa6bc8
into
microsoft:main
29 of 32 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exporting
rand_like,randn_like, orrandint_likewithmemory_format=torch.preserve_formatraised a ConversionError: the torchlib signatures dropped thememory_formatkwarg the aten schema declares. Adds it as a no-op trailing kwarg on the four*_likerandom ops, matching what #2994 did forfull_like.Fixes #3002.
Changes:
ops/core.py: addmemory_formattoaten_rand_like,aten_randn_like,aten_randint_like,aten_randint_like_low_dtypememory_format=torch.preserve_formatTesting: the new tests assert export succeeds rather than value equality, since these ops are non-deterministic.