Hide torch_python symbols (#142214)

Change symbols in torch_python to invisible by default on platforms other than Apple.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/142214
Approved by: https://github.com/ezyang
This commit is contained in:
cyy
2024-12-16 00:59:26 +00:00
committed by PyTorch MergeBot
parent 744a303dee
commit af8789c056
12 changed files with 27 additions and 19 deletions

View File

@ -46,6 +46,7 @@
#include <torch/csrc/Dtype.h>
#include <torch/csrc/DynamicTypes.h>
#include <torch/csrc/Event.h>
#include <torch/csrc/Export.h>
#include <torch/csrc/Generator.h>
#include <torch/csrc/Layout.h>
#include <torch/csrc/MemoryFormat.h>
@ -1717,7 +1718,7 @@ class WeakTensorRef {
}
};
extern "C" C10_EXPORT PyObject* initModule();
extern "C" TORCH_PYTHON_API PyObject* initModule();
// separate decl and defn for msvc error C2491
PyObject* initModule() {
HANDLE_TH_ERRORS