Skip to content

Commit

Permalink
Remove WindowsTorchApiMacro.h in favor of Export.h (pytorch#69585)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
peterbell10 authored and facebook-github-bot committed Dec 10, 2021
1 parent f87f1d0 commit b2e79ed
Show file tree
Hide file tree
Showing 235 changed files with 233 additions and 237 deletions.
1 change: 0 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,6 @@ cc_library(
name = "aten_headers",
hdrs = [
"torch/csrc/Export.h",
"torch/csrc/WindowsTorchApiMacro.h",
"torch/csrc/jit/frontend/function_schema_parser.h",
] + glob([
"aten/src/**/*.h",
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/SequenceNumber.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <cstdint>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <c10/macros/Export.h>

namespace at {

Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/TracerMode.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <c10/core/impl/LocalDispatchKeySet.h>
#include <c10/macros/Macros.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <c10/macros/Export.h>

// NOTE [Tracing Mode Switches]
//
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/TypeDefault.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <c10/core/MemoryFormat.h>
#include <c10/util/ArrayRef.h>
#include <c10/util/intrusive_ptr.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <c10/macros/Export.h>
#include <ATen/Dimname.h>

namespace c10 {
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/core/Dict.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#pragma once

#include <c10/macros/Macros.h>
#include <c10/macros/Export.h>
#include <c10/util/TypeTraits.h>
#include <c10/util/TypeList.h>
#include <c10/util/intrusive_ptr.h>
#include <c10/util/order_preserving_flat_hash_map.h>
#include <c10/util/Optional.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <ATen/core/TensorBody.h>

namespace c10 {
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/core/List.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

#include <ATen/core/ivalue_to.h>
#include <c10/macros/Macros.h>
#include <c10/macros/Export.h>
#include <c10/util/TypeTraits.h>
#include <c10/util/TypeList.h>
#include <c10/util/intrusive_ptr.h>
#include <c10/util/ArrayRef.h>
#include <c10/util/Optional.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <vector>

namespace at {
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/core/ivalue.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <c10/util/C++17.h>
#include <c10/util/MaybeOwned.h>
#include <c10/util/intrusive_ptr.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <c10/macros/Export.h>
#include <typeindex>

namespace torch {
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/templates/TensorBody.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
#include <c10/util/MaybeOwned.h>
#include <c10/util/Optional.h>
#include <c10/util/intrusive_ptr.h>
#include <c10/macros/Export.h>
#include <ATen/core/DeprecatedTypePropertiesRegistry.h>
#include <ATen/core/DeprecatedTypeProperties.h>
#include <ATen/core/NamedTensor.h>
#include <ATen/core/QuantizerBase.h>
#include <ATen/core/TensorBase.h>
#include <torch/csrc/WindowsTorchApiMacro.h>

namespace c10{
template<class T> class List;
Expand Down
2 changes: 1 addition & 1 deletion test/cpp/jit/torch_python_test.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <ATen/core/ivalue.h>
#include <c10/util/Exception.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>
#include <torch/csrc/jit/api/module.h>
#include <torch/script.h>

Expand Down
2 changes: 1 addition & 1 deletion tools/autograd/templates/VariableType.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <c10/util/intrusive_ptr.h>

#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>
#include <torch/csrc/autograd/autograd_not_implemented_fallback.h>

#include <cstdint> // for size_t
Expand Down
1 change: 0 additions & 1 deletion tools/build_variables.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def libtorch_generated_sources(gencode_pattern):
jit_core_headers = [
"torch/csrc/utils/memory.h",
"torch/csrc/Export.h",
"torch/csrc/WindowsTorchApiMacro.h",
"torch/csrc/jit/frontend/source_range.h",
"torch/csrc/jit/serialization/callstack_debug_info_serialization.h",
"torch/csrc/jit/serialization/source_range_serialization.h",
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/CudaIPCTypes.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#ifdef USE_CUDA
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>
#include <c10/core/Allocator.h>
#include <c10/cuda/CUDACachingAllocator.h>
#include <c10/cuda/CUDAException.h>
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/Device.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <torch/csrc/python_headers.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>

#include <ATen/Device.h>

Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/Dtype.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <ATen/ATen.h>
#include <torch/csrc/python_headers.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>

const int DTYPE_NAME_LEN = 64;

Expand Down
2 changes: 0 additions & 2 deletions torch/csrc/WindowsTorchApiMacro.h

This file was deleted.

2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/cuda.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>

#include <cstdint>
#include <cstddef>
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/data/datasets/mnist.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <torch/data/example.h>
#include <torch/types.h>

#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>

#include <cstddef>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/data/samplers/base.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>
#include <torch/types.h>

#include <cstddef>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <cstddef>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>

namespace torch {
namespace data {
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/data/samplers/distributed.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>
#include <torch/data/samplers/base.h>

#include <cstddef>
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/data/samplers/random.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>
#include <torch/data/samplers/base.h>
#include <torch/types.h>

Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/data/samplers/sequential.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>
#include <torch/data/samplers/base.h>
#include <torch/types.h>

Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/data/samplers/stream.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>
#include <torch/data/samplers/base.h>
#include <torch/data/samplers/custom_batch_request.h>
#include <torch/types.h>
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <ATen/core/Reduction.h>
#include <c10/util/Exception.h>
#include <c10/util/variant.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>

#define TORCH_ENUM_DECLARE(name) \
namespace torch { \
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/jit.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>
#include <torch/csrc/jit/api/module.h>

#include <string>
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/nn/init.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>
#include <torch/enum.h>
#include <torch/types.h>

Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/nn/modules/activation.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <torch/nn/modules/common.h>
#include <torch/nn/modules/linear.h>

#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>

namespace torch {
namespace nn {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <torch/nn/cloneable.h>
#include <torch/nn/pimpl.h>
#include <torch/types.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>

#include <functional>
#include <utility>
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/nn/modules/conv.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <torch/nn/pimpl.h>
#include <torch/types.h>

#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>

#include <cstddef>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/nn/modules/distance.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <torch/nn/pimpl.h>
#include <torch/types.h>

#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>

namespace torch {
namespace nn {
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/nn/modules/dropout.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <torch/nn/pimpl.h>
#include <torch/types.h>

#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>

#include <cstddef>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/nn/modules/loss.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <torch/nn/pimpl.h>
#include <torch/types.h>

#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>

#include <cstddef>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/nn/modules/padding.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <torch/nn/cloneable.h>
#include <torch/nn/functional/padding.h>

#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>

namespace torch {
namespace nn {
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/nn/modules/pixelshuffle.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <torch/nn/functional/pixelshuffle.h>
#include <torch/nn/options/pixelshuffle.h>

#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>

namespace torch {
namespace nn {
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/nn/modules/pooling.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <torch/nn/functional/pooling.h>
#include <torch/nn/modules/common.h>

#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>

namespace torch {
namespace nn {
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/nn/modules/upsampling.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <torch/nn/pimpl.h>
#include <torch/types.h>

#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>

#include <cstddef>
#include <ostream>
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/nn/options/activation.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <torch/arg.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>
#include <torch/types.h>

namespace torch {
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/nn/options/adaptive.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <torch/arg.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>
#include <torch/types.h>

namespace torch {
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/nn/options/batchnorm.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <torch/arg.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>
#include <torch/types.h>

namespace torch {
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/nn/options/conv.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <torch/arg.h>
#include <torch/enum.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>
#include <torch/expanding_array.h>
#include <torch/types.h>

Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/nn/options/distance.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <torch/arg.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>
#include <torch/types.h>

namespace torch {
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/nn/options/dropout.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <torch/arg.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>
#include <torch/types.h>

namespace torch {
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/nn/options/embedding.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <torch/arg.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>
#include <torch/types.h>
#include <torch/enum.h>

Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/api/include/torch/nn/options/fold.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <torch/arg.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <torch/csrc/Export.h>
#include <torch/expanding_array.h>
#include <torch/types.h>

Expand Down
Loading

0 comments on commit b2e79ed

Please sign in to comment.