-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[ONNX] add an utility function to check whether it's in the middle of onnx export or not #19050
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
Conversation
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.
A bit hacky, but I guess should work. I presume onnx is never called from multiple threads, so global is ok
| return utils._run_symbolic_method(*args, **kwargs) | ||
|
|
||
|
|
||
| def is_in_onnx_export(): |
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.
add docstring to it?
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.
Sure!
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.
added the doc to onnx/utils.py. We probably should move all the doc to init.py
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.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
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.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@pytorchbot retest this please |
|
@houseroad merged this pull request in ba77ead. |
…xport or not Summary: Pull Request resolved: pytorch#19050 Reviewed By: yinghai Differential Revision: D14849878 Pulled By: houseroad fbshipit-source-id: a0a4a57f5f9f315ba1334edfccc9284a8099d17f
No description provided.