-
Notifications
You must be signed in to change notification settings - Fork 505
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
add depreacated decorator #7703
Conversation
The decorator makes sense here, but not because xla/torch_xla/experimental/pjrt.py Lines 28 to 31 in b1f2167
You would need the decorator if the implementation of the old function is actually different than the new one. In this case, the signatures of Having said that, you can make
Or, you can put this idea to work in
|
Thanks for the point. It's mostly about the warning message. If we did something like:
It will warn like |
I see, good catch. It looks like
|
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.
Thanks!
Introduce the
mark_deprecated
decorator to map deprecated function to the new function. The reason is that existing deprecated function only maps to function with the same name. It's impossible to map function likexrt_world_size
toworld_size
.Instead of passing old function to the deprecation wrapper, I think use the decorator above the old function is the most straightward.
Example to use:
Output: