"examples/tutorials/streamreader_advanced_tutorial.py" did not exist on "10d1bd89e8adcf5210adcd4d25593f8588138816"
Unverified Commit d6102173 authored by Vasilis Vryniotis's avatar Vasilis Vryniotis Committed by GitHub
Browse files

[PyTorch] Fix windows build for torchvision when `MOBILE` is defined (#4571) (#4742)

Summary:
Pull Request resolved: https://github.com/pytorch/vision/pull/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: default avatarMengwei Liu <larryliu@fb.com>
parent 7839bdbe
......@@ -13,13 +13,14 @@
#endif
// If we are in a Windows environment, we need to define
// initialization functions for the _custom_ops extension
#ifdef _WIN32
// initialization functions for the _custom_ops extension.
// For PyMODINIT_FUNC to work, we need to include Python.h
#if !defined(MOBILE) && defined(_WIN32)
PyMODINIT_FUNC PyInit__C(void) {
// No need to do anything.
return NULL;
}
#endif
#endif // !defined(MOBILE) && defined(_WIN32)
namespace vision {
int64_t cuda_version() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment