Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18763
Without `link_whole` flag in opt-builds some of the files are not linked into `_C_impl` library, which causes some of static initializers not to run (namely, registering an cutomPythonOperation from python_interpreter.cpp). This diff fixes it.
Differential Revision:
D14732471
fbshipit-source-id:
57cff6b4b6d479ad7ab7fd29f677746d91d6ff45
"torch/csrc/distributed/**/*.cpp",
# top-level hook of extension registration lives in a separate file
"torch/csrc/stub.cpp",
+ # to avoid redefinitions of symbols defined in
+ # dynamic_library_unix.cpp
+ "torch/csrc/jit/fuser/cpu/dynamic_library_win.cpp",
],
) + [
"torch/csrc/distributed/Module.cpp",
cpp_library(
name="_C_impl",
srcs=libtorch_python_sources,
+ link_whole=True,
deps=[
":libtorch_cuda",
":thnn",