Accept memory_format kwarg on rand/randn/randint _like ops - #3011
Open
fruet (gabrielfruet) wants to merge 1 commit into
Open
Accept memory_format kwarg on rand/randn/randint _like ops#3011fruet (gabrielfruet) wants to merge 1 commit into
fruet (gabrielfruet) wants to merge 1 commit into
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 32204 32210 +6
Branches 3041 3042 +1
=======================================
+ Hits 23391 23397 +6
Misses 7779 7779
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 |
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.