-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add getPyInterpreter() API #62659
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 getPyInterpreter() API #62659
Conversation
It turns out that it is occasionally useful to be able to access the PyInterpreter object from other Python bindings (see next diff in the stack). Make it publicly available. Signed-off-by: Edward Z. Yang <ezyang@fb.com> [ghstack-poisoned]
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit 40aafaa (more details on the Dr. CI page):
1 failure not recognized by patterns:
🚧 9 fixed upstream failures:These were probably caused by upstream breakages that were already fixed.
Please rebase on the
|
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
return THPVariable_Unpack(reinterpret_cast<THPVariable*>(obj)); | ||
} | ||
|
||
THP_API c10::impl::PyInterpreter* getPyInterpreter(); |
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.
How is THP_API
different from TORCH_API
? (and why do we want it here?)
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.
it's the one for stuff in torch_python, which this file is in
Stack from ghstack:
It turns out that it is occasionally useful to be able to access the
PyInterpreter object from other Python bindings (see next diff in the
stack). Make it publicly available.
Signed-off-by: Edward Z. Yang ezyang@fb.com
Differential Revision: D30074926