You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Currently when we deserialize inputs to nodes, we deserialize arguments with default values as kwargs. So deserializing aten.uniform, which has the signature uniform(Tensor(a!) self, float from=0, float to=1, *, Generator? generator=None) -> Tensor(a!), will get become uniform(x, from=0, to=1). However, this fails when running in python because from is a python keyword. So the solution here is to not deserialize it as a kwarg.
I mean I can accept this as a short term measure, but why this schema has a keyable argument with keyword name in this first place... Does that mean no one will ever be able to use this argument with the name in Python?
@zhxchen17 I think it's probably a bug that the op's schema has a kwarg with a keyword name, or it was not expected to be used this way, since it seems like the op was added into native_functions.yaml long long ago
Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.
Currently when we deserialize inputs to nodes, we deserialize arguments with default values as kwargs. So deserializing `aten.uniform`, which has the signature `uniform(Tensor(a!) self, float from=0, float to=1, *, Generator? generator=None) -> Tensor(a!)`, will get become `uniform(x, from=0, to=1)`. However, this fails when running in python because `from` is a python keyword. So the solution here is to not deserialize it as a kwarg.
Pull Request resolved: pytorch#136036
Approved by: https://github.com/zhxchen17
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.
Currently when we deserialize inputs to nodes, we deserialize arguments with default values as kwargs. So deserializing
aten.uniform
, which has the signatureuniform(Tensor(a!) self, float from=0, float to=1, *, Generator? generator=None) -> Tensor(a!)
, will get becomeuniform(x, from=0, to=1)
. However, this fails when running in python becausefrom
is a python keyword. So the solution here is to not deserialize it as a kwarg.