-
Notifications
You must be signed in to change notification settings - Fork 7.2k
[PyTorch] Fix windows build for torchvision #4571
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
[PyTorch] Fix windows build for torchvision #4571
Conversation
|
This pull request was exported from Phabricator. Differential Revision: D31488734 |
…ytorch#4571) Summary: Pull Request resolved: pytorch#4571 Fixing windows build for `torchvision` when `MOBILE` is defined. In `csrc/vision.cpp`, since `PyMODINIT_FUNC` depends on `Python.h` I added the same condition for `PyMODINIT_FUNC` as the one for `import <PyTorch.h>`. Reviewed By: malfet Differential Revision: D31488734 fbshipit-source-id: 88f24ccffbc3e05f0b7ecbb63dff16d41c8b5592
|
This pull request was exported from Phabricator. Differential Revision: D31488734 |
2cff471 to
e0df602
Compare
…4571) Summary: Pull Request resolved: #4571 Fixing windows build for `torchvision` when `MOBILE` is defined. In `csrc/vision.cpp`, since `PyMODINIT_FUNC` depends on `Python.h` I added the same condition for `PyMODINIT_FUNC` as the one for `import <PyTorch.h>`. Reviewed By: malfet Differential Revision: D31488734 fbshipit-source-id: fd52a9ab161288d9c8bf3b9e0ab9da856a4ebadb
datumbox
left a comment
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.
LGTM. I'm not going to approve as we can't merge on fbsync branch. Feel free to merge on FBcode and we'll take care of the rest of the syncs.
| return NULL; | ||
| } | ||
| #endif | ||
| #endif // !defined(MOBILE) && defined(_WIN32) |
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.
Just an optional nitpick. I checked the code-base and we typically do't mark endifs like this:
| #endif // !defined(MOBILE) && defined(_WIN32) | |
| #endif |
…ytorch#4571) Summary: Pull Request resolved: pytorch#4571 Fixing windows build for `torchvision` when `MOBILE` is defined. In `csrc/vision.cpp`, since `PyMODINIT_FUNC` depends on `Python.h` I added the same condition for `PyMODINIT_FUNC` as the one for `import <PyTorch.h>`. Reviewed By: malfet Differential Revision: D31488734 fbshipit-source-id: fd52a9ab161288d9c8bf3b9e0ab9da856a4ebadb
…4571) (#4742) Summary: Pull Request resolved: #4571 Fixing windows build for `torchvision` when `MOBILE` is defined. In `csrc/vision.cpp`, since `PyMODINIT_FUNC` depends on `Python.h` I added the same condition for `PyMODINIT_FUNC` as the one for `import <PyTorch.h>`. Reviewed By: malfet Differential Revision: D31488734 fbshipit-source-id: fd52a9ab161288d9c8bf3b9e0ab9da856a4ebadb Co-authored-by: Mengwei Liu <[email protected]>
…ytorch#4571) (pytorch#4742) Summary: Pull Request resolved: pytorch#4571 Fixing windows build for `torchvision` when `MOBILE` is defined. In `csrc/vision.cpp`, since `PyMODINIT_FUNC` depends on `Python.h` I added the same condition for `PyMODINIT_FUNC` as the one for `import <PyTorch.h>`. Reviewed By: malfet Differential Revision: D31488734 fbshipit-source-id: fd52a9ab161288d9c8bf3b9e0ab9da856a4ebadb Co-authored-by: Mengwei Liu <[email protected]>
Summary:
Fixing windows build for
torchvision. Incsrc/vision.cpp, sincePyMODINIT_FUNCdepends onPython.hI added the same condition forPyMODINIT_FUNCas the one forimport <PyTorch.h>.Differential Revision: D31488734