Fix: Add dtype to empty_like function - #4037
Closed
JasonHonKL wants to merge 8 commits into
Closed
Conversation
zcbenz
requested changes
Aug 7, 2026
zcbenz
left a comment
Member
There was a problem hiding this comment.
Can you make the C++ zeros_like take additional dtype while keeping empty_like unchanged as an alias? Also we prefer hiding empty/empty_like from public APIs as we don't want to have multiple APIs doing the same thing.
Contributor
Author
|
@zcbenz Sure no problem. |
Contributor
Author
|
@zcbenz Removed the public APIs. Since at the beginning zero_likes is the same as empty_like, and zero_likes is updated, this PR just adds tests to verify empty_like. Thanks for the reminder ! |
Member
|
Ah sorry I forgot #4028 just updated the zeros_like. Since empty_like is a trivial alias of zeros_like we don't really need to add more tests, so I'm closing this PR. |
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.
Proposed changes
(Please merge previous PR) @reckylurker
Fix #4001
Update
Added test with the empty_like function. Remove public APIs of empty like.
Checklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes