Skip to content

Commit b2e79ed

Browse files
peterbell10facebook-github-bot
authored andcommitted
Remove WindowsTorchApiMacro.h in favor of Export.h (pytorch#69585)
Summary: Follow up to pytorch#68095 This also changes the files from the ATen folder to include c10's `Export.h` instead since they can't ever be exporting `TORCH_PYTHON_API`. cc pietern mrshenli pritamdamania87 zhaojuanmao satgera rohan-varma gqchen aazzolini osalpekar jiayisuse SciPioneer H-Huang Pull Request resolved: pytorch#69585 Reviewed By: mrshenli Differential Revision: D32958594 Pulled By: albanD fbshipit-source-id: 1ec7ef63764573fa2b486928955e3a1172150061
1 parent f87f1d0 commit b2e79ed

File tree

235 files changed

+233
-237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

235 files changed

+233
-237
lines changed

Diff for: BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,6 @@ cc_library(
524524
name = "aten_headers",
525525
hdrs = [
526526
"torch/csrc/Export.h",
527-
"torch/csrc/WindowsTorchApiMacro.h",
528527
"torch/csrc/jit/frontend/function_schema_parser.h",
529528
] + glob([
530529
"aten/src/**/*.h",

Diff for: aten/src/ATen/SequenceNumber.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#include <cstdint>
4-
#include <torch/csrc/WindowsTorchApiMacro.h>
4+
#include <c10/macros/Export.h>
55

66
namespace at {
77

Diff for: aten/src/ATen/TracerMode.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include <c10/core/impl/LocalDispatchKeySet.h>
44
#include <c10/macros/Macros.h>
5-
#include <torch/csrc/WindowsTorchApiMacro.h>
5+
#include <c10/macros/Export.h>
66

77
// NOTE [Tracing Mode Switches]
88
//

Diff for: aten/src/ATen/TypeDefault.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <c10/core/MemoryFormat.h>
77
#include <c10/util/ArrayRef.h>
88
#include <c10/util/intrusive_ptr.h>
9-
#include <torch/csrc/WindowsTorchApiMacro.h>
9+
#include <c10/macros/Export.h>
1010
#include <ATen/Dimname.h>
1111

1212
namespace c10 {

Diff for: aten/src/ATen/core/Dict.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#pragma once
22

33
#include <c10/macros/Macros.h>
4+
#include <c10/macros/Export.h>
45
#include <c10/util/TypeTraits.h>
56
#include <c10/util/TypeList.h>
67
#include <c10/util/intrusive_ptr.h>
78
#include <c10/util/order_preserving_flat_hash_map.h>
89
#include <c10/util/Optional.h>
9-
#include <torch/csrc/WindowsTorchApiMacro.h>
1010
#include <ATen/core/TensorBody.h>
1111

1212
namespace c10 {

Diff for: aten/src/ATen/core/List.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
#include <ATen/core/ivalue_to.h>
44
#include <c10/macros/Macros.h>
5+
#include <c10/macros/Export.h>
56
#include <c10/util/TypeTraits.h>
67
#include <c10/util/TypeList.h>
78
#include <c10/util/intrusive_ptr.h>
89
#include <c10/util/ArrayRef.h>
910
#include <c10/util/Optional.h>
10-
#include <torch/csrc/WindowsTorchApiMacro.h>
1111
#include <vector>
1212

1313
namespace at {

Diff for: aten/src/ATen/core/ivalue.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <c10/util/C++17.h>
77
#include <c10/util/MaybeOwned.h>
88
#include <c10/util/intrusive_ptr.h>
9-
#include <torch/csrc/WindowsTorchApiMacro.h>
9+
#include <c10/macros/Export.h>
1010
#include <typeindex>
1111

1212
namespace torch {

Diff for: aten/src/ATen/templates/TensorBody.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
#include <c10/util/MaybeOwned.h>
2020
#include <c10/util/Optional.h>
2121
#include <c10/util/intrusive_ptr.h>
22+
#include <c10/macros/Export.h>
2223
#include <ATen/core/DeprecatedTypePropertiesRegistry.h>
2324
#include <ATen/core/DeprecatedTypeProperties.h>
2425
#include <ATen/core/NamedTensor.h>
2526
#include <ATen/core/QuantizerBase.h>
2627
#include <ATen/core/TensorBase.h>
27-
#include <torch/csrc/WindowsTorchApiMacro.h>
2828

2929
namespace c10{
3030
template<class T> class List;

Diff for: test/cpp/jit/torch_python_test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <ATen/core/ivalue.h>
22
#include <c10/util/Exception.h>
3-
#include <torch/csrc/WindowsTorchApiMacro.h>
3+
#include <torch/csrc/Export.h>
44
#include <torch/csrc/jit/api/module.h>
55
#include <torch/script.h>
66

Diff for: tools/autograd/templates/VariableType.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include <c10/util/intrusive_ptr.h>
88

9-
#include <torch/csrc/WindowsTorchApiMacro.h>
9+
#include <torch/csrc/Export.h>
1010
#include <torch/csrc/autograd/autograd_not_implemented_fallback.h>
1111

1212
#include <cstdint> // for size_t

Diff for: tools/build_variables.bzl

-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def libtorch_generated_sources(gencode_pattern):
7272
jit_core_headers = [
7373
"torch/csrc/utils/memory.h",
7474
"torch/csrc/Export.h",
75-
"torch/csrc/WindowsTorchApiMacro.h",
7675
"torch/csrc/jit/frontend/source_range.h",
7776
"torch/csrc/jit/serialization/callstack_debug_info_serialization.h",
7877
"torch/csrc/jit/serialization/source_range_serialization.h",

Diff for: torch/csrc/CudaIPCTypes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22
#ifdef USE_CUDA
3-
#include <torch/csrc/WindowsTorchApiMacro.h>
3+
#include <torch/csrc/Export.h>
44
#include <c10/core/Allocator.h>
55
#include <c10/cuda/CUDACachingAllocator.h>
66
#include <c10/cuda/CUDAException.h>

Diff for: torch/csrc/Device.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#include <torch/csrc/python_headers.h>
4-
#include <torch/csrc/WindowsTorchApiMacro.h>
4+
#include <torch/csrc/Export.h>
55

66
#include <ATen/Device.h>
77

Diff for: torch/csrc/Dtype.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include <ATen/ATen.h>
44
#include <torch/csrc/python_headers.h>
5-
#include <torch/csrc/WindowsTorchApiMacro.h>
5+
#include <torch/csrc/Export.h>
66

77
const int DTYPE_NAME_LEN = 64;
88

Diff for: torch/csrc/WindowsTorchApiMacro.h

-2
This file was deleted.

Diff for: torch/csrc/api/include/torch/cuda.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include <torch/csrc/WindowsTorchApiMacro.h>
3+
#include <torch/csrc/Export.h>
44

55
#include <cstdint>
66
#include <cstddef>

Diff for: torch/csrc/api/include/torch/data/datasets/mnist.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <torch/data/example.h>
55
#include <torch/types.h>
66

7-
#include <torch/csrc/WindowsTorchApiMacro.h>
7+
#include <torch/csrc/Export.h>
88

99
#include <cstddef>
1010
#include <string>

Diff for: torch/csrc/api/include/torch/data/samplers/base.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include <torch/csrc/WindowsTorchApiMacro.h>
3+
#include <torch/csrc/Export.h>
44
#include <torch/types.h>
55

66
#include <cstddef>

Diff for: torch/csrc/api/include/torch/data/samplers/custom_batch_request.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#include <cstddef>
4-
#include <torch/csrc/WindowsTorchApiMacro.h>
4+
#include <torch/csrc/Export.h>
55

66
namespace torch {
77
namespace data {

Diff for: torch/csrc/api/include/torch/data/samplers/distributed.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include <torch/csrc/WindowsTorchApiMacro.h>
3+
#include <torch/csrc/Export.h>
44
#include <torch/data/samplers/base.h>
55

66
#include <cstddef>

Diff for: torch/csrc/api/include/torch/data/samplers/random.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include <torch/csrc/WindowsTorchApiMacro.h>
3+
#include <torch/csrc/Export.h>
44
#include <torch/data/samplers/base.h>
55
#include <torch/types.h>
66

Diff for: torch/csrc/api/include/torch/data/samplers/sequential.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include <torch/csrc/WindowsTorchApiMacro.h>
3+
#include <torch/csrc/Export.h>
44
#include <torch/data/samplers/base.h>
55
#include <torch/types.h>
66

Diff for: torch/csrc/api/include/torch/data/samplers/stream.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include <torch/csrc/WindowsTorchApiMacro.h>
3+
#include <torch/csrc/Export.h>
44
#include <torch/data/samplers/base.h>
55
#include <torch/data/samplers/custom_batch_request.h>
66
#include <torch/types.h>

Diff for: torch/csrc/api/include/torch/enum.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <ATen/core/Reduction.h>
66
#include <c10/util/Exception.h>
77
#include <c10/util/variant.h>
8-
#include <torch/csrc/WindowsTorchApiMacro.h>
8+
#include <torch/csrc/Export.h>
99

1010
#define TORCH_ENUM_DECLARE(name) \
1111
namespace torch { \

Diff for: torch/csrc/api/include/torch/jit.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include <torch/csrc/WindowsTorchApiMacro.h>
3+
#include <torch/csrc/Export.h>
44
#include <torch/csrc/jit/api/module.h>
55

66
#include <string>

Diff for: torch/csrc/api/include/torch/nn/init.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include <torch/csrc/WindowsTorchApiMacro.h>
3+
#include <torch/csrc/Export.h>
44
#include <torch/enum.h>
55
#include <torch/types.h>
66

Diff for: torch/csrc/api/include/torch/nn/modules/activation.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <torch/nn/modules/common.h>
77
#include <torch/nn/modules/linear.h>
88

9-
#include <torch/csrc/WindowsTorchApiMacro.h>
9+
#include <torch/csrc/Export.h>
1010

1111
namespace torch {
1212
namespace nn {

Diff for: torch/csrc/api/include/torch/nn/modules/container/functional.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <torch/nn/cloneable.h>
55
#include <torch/nn/pimpl.h>
66
#include <torch/types.h>
7-
#include <torch/csrc/WindowsTorchApiMacro.h>
7+
#include <torch/csrc/Export.h>
88

99
#include <functional>
1010
#include <utility>

Diff for: torch/csrc/api/include/torch/nn/modules/conv.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <torch/nn/pimpl.h>
1414
#include <torch/types.h>
1515

16-
#include <torch/csrc/WindowsTorchApiMacro.h>
16+
#include <torch/csrc/Export.h>
1717

1818
#include <cstddef>
1919
#include <vector>

Diff for: torch/csrc/api/include/torch/nn/modules/distance.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <torch/nn/pimpl.h>
77
#include <torch/types.h>
88

9-
#include <torch/csrc/WindowsTorchApiMacro.h>
9+
#include <torch/csrc/Export.h>
1010

1111
namespace torch {
1212
namespace nn {

Diff for: torch/csrc/api/include/torch/nn/modules/dropout.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <torch/nn/pimpl.h>
66
#include <torch/types.h>
77

8-
#include <torch/csrc/WindowsTorchApiMacro.h>
8+
#include <torch/csrc/Export.h>
99

1010
#include <cstddef>
1111
#include <vector>

Diff for: torch/csrc/api/include/torch/nn/modules/loss.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <torch/nn/pimpl.h>
88
#include <torch/types.h>
99

10-
#include <torch/csrc/WindowsTorchApiMacro.h>
10+
#include <torch/csrc/Export.h>
1111

1212
#include <cstddef>
1313
#include <vector>

Diff for: torch/csrc/api/include/torch/nn/modules/padding.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <torch/nn/cloneable.h>
55
#include <torch/nn/functional/padding.h>
66

7-
#include <torch/csrc/WindowsTorchApiMacro.h>
7+
#include <torch/csrc/Export.h>
88

99
namespace torch {
1010
namespace nn {

Diff for: torch/csrc/api/include/torch/nn/modules/pixelshuffle.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <torch/nn/functional/pixelshuffle.h>
55
#include <torch/nn/options/pixelshuffle.h>
66

7-
#include <torch/csrc/WindowsTorchApiMacro.h>
7+
#include <torch/csrc/Export.h>
88

99
namespace torch {
1010
namespace nn {

Diff for: torch/csrc/api/include/torch/nn/modules/pooling.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <torch/nn/functional/pooling.h>
77
#include <torch/nn/modules/common.h>
88

9-
#include <torch/csrc/WindowsTorchApiMacro.h>
9+
#include <torch/csrc/Export.h>
1010

1111
namespace torch {
1212
namespace nn {

Diff for: torch/csrc/api/include/torch/nn/modules/upsampling.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <torch/nn/pimpl.h>
77
#include <torch/types.h>
88

9-
#include <torch/csrc/WindowsTorchApiMacro.h>
9+
#include <torch/csrc/Export.h>
1010

1111
#include <cstddef>
1212
#include <ostream>

Diff for: torch/csrc/api/include/torch/nn/options/activation.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#include <torch/arg.h>
4-
#include <torch/csrc/WindowsTorchApiMacro.h>
4+
#include <torch/csrc/Export.h>
55
#include <torch/types.h>
66

77
namespace torch {

Diff for: torch/csrc/api/include/torch/nn/options/adaptive.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#include <torch/arg.h>
4-
#include <torch/csrc/WindowsTorchApiMacro.h>
4+
#include <torch/csrc/Export.h>
55
#include <torch/types.h>
66

77
namespace torch {

Diff for: torch/csrc/api/include/torch/nn/options/batchnorm.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#include <torch/arg.h>
4-
#include <torch/csrc/WindowsTorchApiMacro.h>
4+
#include <torch/csrc/Export.h>
55
#include <torch/types.h>
66

77
namespace torch {

Diff for: torch/csrc/api/include/torch/nn/options/conv.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include <torch/arg.h>
44
#include <torch/enum.h>
5-
#include <torch/csrc/WindowsTorchApiMacro.h>
5+
#include <torch/csrc/Export.h>
66
#include <torch/expanding_array.h>
77
#include <torch/types.h>
88

Diff for: torch/csrc/api/include/torch/nn/options/distance.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#include <torch/arg.h>
4-
#include <torch/csrc/WindowsTorchApiMacro.h>
4+
#include <torch/csrc/Export.h>
55
#include <torch/types.h>
66

77
namespace torch {

Diff for: torch/csrc/api/include/torch/nn/options/dropout.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#include <torch/arg.h>
4-
#include <torch/csrc/WindowsTorchApiMacro.h>
4+
#include <torch/csrc/Export.h>
55
#include <torch/types.h>
66

77
namespace torch {

Diff for: torch/csrc/api/include/torch/nn/options/embedding.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#include <torch/arg.h>
4-
#include <torch/csrc/WindowsTorchApiMacro.h>
4+
#include <torch/csrc/Export.h>
55
#include <torch/types.h>
66
#include <torch/enum.h>
77

Diff for: torch/csrc/api/include/torch/nn/options/fold.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#include <torch/arg.h>
4-
#include <torch/csrc/WindowsTorchApiMacro.h>
4+
#include <torch/csrc/Export.h>
55
#include <torch/expanding_array.h>
66
#include <torch/types.h>
77

0 commit comments

Comments
 (0)