File tree Expand file tree Collapse file tree 15 files changed +34
-49
lines changed Expand file tree Collapse file tree 15 files changed +34
-49
lines changed Original file line number Diff line number Diff line change @@ -542,6 +542,7 @@ header_template_rule(
542
542
cc_library (
543
543
name = "aten_headers" ,
544
544
hdrs = [
545
+ "torch/csrc/Export.h" ,
545
546
"torch/csrc/WindowsTorchApiMacro.h" ,
546
547
"torch/csrc/jit/frontend/function_schema_parser.h" ,
547
548
] + glob ([
Original file line number Diff line number Diff line change 6
6
#include < ATen/core/functional.h>
7
7
#include < ATen/TensorGeometry.h>
8
8
9
- #include " torch/csrc/THP_export.h"
10
9
#include " torch/csrc/autograd/function.h"
11
10
#include " torch/csrc/autograd/variable.h"
12
11
#include " torch/csrc/autograd/saved_variable.h"
13
- #include < torch/csrc/WindowsTorchApiMacro .h>
12
+ #include < torch/csrc/Export .h>
14
13
15
14
namespace torch { namespace autograd { namespace generated {
16
15
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ def libtorch_generated_sources(gencode_pattern):
71
71
# copied from https://github.com/pytorch/pytorch/blob/f99a693cd9ff7a9b5fdc71357dac66b8192786d3/aten/src/ATen/core/CMakeLists.txt
72
72
jit_core_headers = [
73
73
"torch/csrc/utils/memory.h" ,
74
+ "torch/csrc/Export.h" ,
74
75
"torch/csrc/WindowsTorchApiMacro.h" ,
75
76
"torch/csrc/jit/frontend/source_range.h" ,
76
77
"torch/csrc/jit/serialization/callstack_debug_info_serialization.h" ,
Original file line number Diff line number Diff line change 9
9
10
10
#include < c10/util/Exception.h>
11
11
#include < pybind11/pybind11.h>
12
- #include < torch/csrc/THP_export .h>
12
+ #include < torch/csrc/Export .h>
13
13
#include < torch/csrc/utils/auto_gil.h>
14
14
#include < torch/csrc/jit/runtime/jit_exception.h>
15
- #include < torch/csrc/WindowsTorchApiMacro.h>
16
15
#include < c10/util/StringUtil.h>
17
16
#include < ATen/detail/FunctionTraits.h>
18
17
@@ -259,9 +258,9 @@ bool THPException_init(PyObject *module);
259
258
260
259
namespace torch {
261
260
262
- THP_CLASS std::string processErrorMsg (std::string str);
261
+ TORCH_PYTHON_API std::string processErrorMsg (std::string str);
263
262
264
- THP_API bool get_cpp_stacktraces_enabled ();
263
+ TORCH_PYTHON_API bool get_cpp_stacktraces_enabled ();
265
264
266
265
// Abstract base class for exceptions which translate to specific Python types
267
266
struct PyTorchError : public std ::exception {
Original file line number Diff line number Diff line change
1
+ #pragma once
2
+
3
+ #include <c10/macros/Export.h>
4
+
5
+ #ifdef THP_BUILD_MAIN_LIB
6
+ #define TORCH_PYTHON_API C10_EXPORT
7
+ #else
8
+ #define TORCH_PYTHON_API C10_IMPORT
9
+ #endif
Original file line number Diff line number Diff line change 1
1
#pragma once
2
2
3
+ #include <torch/csrc/Export.h>
3
4
#include <torch/csrc/python_headers.h>
4
5
#include <ATen/ATen.h>
5
6
6
- #include <torch/csrc/THP_export.h>
7
7
8
8
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
9
9
struct THPGenerator {
@@ -14,16 +14,16 @@ struct THPGenerator {
14
14
// Creates a new Python object wrapping the default at::Generator. The reference is
15
15
// borrowed. The caller should ensure that the at::Generator object lifetime
16
16
// last at least as long as the Python wrapper.
17
- THP_API PyObject * THPGenerator_initDefaultGenerator (at ::Generator cdata );
17
+ TORCH_PYTHON_API PyObject * THPGenerator_initDefaultGenerator (at ::Generator cdata );
18
18
19
19
#define THPGenerator_Check (obj ) \
20
20
PyObject_IsInstance(obj, THPGeneratorClass)
21
21
22
- THP_API PyObject * THPGeneratorClass ;
22
+ TORCH_PYTHON_API extern PyObject * THPGeneratorClass ;
23
23
24
24
bool THPGenerator_init (PyObject * module );
25
25
26
- THP_API PyObject * THPGenerator_Wrap (at ::Generator gen );
26
+ TORCH_PYTHON_API PyObject * THPGenerator_Wrap (at ::Generator gen );
27
27
28
28
// Creates a new Python object for a Generator. The Generator must not already
29
29
// have a PyObject* associated with it.
Original file line number Diff line number Diff line change 5
5
#include <TH/TH.h>
6
6
#include <TH/THTensor.hpp>
7
7
8
- #include <torch/csrc/THP_export .h>
8
+ #include <torch/csrc/Export .h>
9
9
10
10
// Back-compatibility macros, Thanks to http://cx-oracle.sourceforge.net/
11
11
// define PyInt_* macros for Python 3.x. NB: We must include Python.h first,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
#pragma once
2
-
3
- #include <c10/macros/Export.h>
4
-
5
- #ifdef _WIN32
6
- #define TORCH_PYTHON_API
7
- #else
8
- #define TORCH_PYTHON_API TORCH_API
9
- #endif
2
+ #include <torch/csrc/Export.h>
Original file line number Diff line number Diff line change 4
4
#include < torch/csrc/autograd/python_variable.h>
5
5
#include < torch/csrc/autograd/saved_variable_hooks.h>
6
6
#include < torch/csrc/python_headers.h>
7
- #include < torch/csrc/THP_export .h>
7
+ #include < torch/csrc/Export .h>
8
8
#include < ATen/ATen.h>
9
9
10
10
namespace py = pybind11;
You can’t perform that action at this time.
0 commit comments