Skip to content

Commit e533528

Browse files
committed
[PyTorch] Remove unnecessary dispatcher.h include in torch/library.h
It's unused. Differential Revision: [D25859010](https://our.internmc.facebook.com/intern/diff/D25859010/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D25859010/)! [ghstack-poisoned]
1 parent e843974 commit e533528

7 files changed

Lines changed: 7 additions & 3 deletions

File tree

aten/src/ATen/BatchedFallback.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <ATen/BatchedFallback.h>
22
#include <ATen/MatrixRef.h>
33
#include <ATen/VmapTransforms.h>
4+
#include <ATen/core/dispatch/Dispatcher.h>
45
#include <c10/util/llvmMathExtras.h>
56

67
namespace at {

aten/src/ATen/core/dispatch/backend_fallback_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <ATen/ATen.h>
44
#include <ATen/NativeFunctions.h>
55
#include <ATen/Functions.h>
6+
#include <ATen/core/dispatch/Dispatcher.h>
67
#include <ATen/core/op_registration/op_registration.h>
78
#include <torch/library.h>
89

aten/src/ATen/core/library.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include <torch/library.h>
22

3+
#include <ATen/core/dispatch/Dispatcher.h>
4+
35
namespace torch {
46

57
namespace {

aten/src/ATen/templates/RegisterBackendSelect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// We register ops with a higher priority dispatch key (BackendSelect) than the usual backend-specific keys (e.g. CPU)
22
// which makes calls to the factory functions dispatch to here.
33
// We then 'manually' compute a lower-priority to re-dispatch to (e.g. CPU) to get to the eventually correct backend.
4-
54
// ${generated_comment}
65

76
#include <ATen/ATen.h>
87
#include <ATen/Dispatch.h>
8+
#include <ATen/core/dispatch/Dispatcher.h>
99
#include <torch/library.h>
1010
#include <c10/core/TensorOptions.h>
1111

tools/codegen/gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ def write_with_template(self, filename: str, template_fn: str,
11271127
if isinstance(env, dict):
11281128
# TODO: Update the comment reference to the correct location
11291129
if 'generated_comment' not in env:
1130-
comment = "@" + "generated by aten/src/ATen/gen.py"
1130+
comment = "@" + "generated by tools/codegen/gen.py"
11311131
comment += " from {}".format(os.path.basename(template_fn))
11321132
env['generated_comment'] = comment
11331133
template = _read_template(os.path.join(self.template_dir, template_fn))

torch/csrc/utils/python_dispatch.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <torch/library.h>
55
#include <ATen/ATen.h>
6+
#include <ATen/core/dispatch/Dispatcher.h>
67

78
#include <pybind11/operators.h>
89

torch/library.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
/// ```
6060

6161
#include <c10/core/DispatchKey.h>
62-
#include <ATen/core/dispatch/Dispatcher.h>
6362
#include <ATen/core/op_registration/op_whitelist.h>
6463
#include <ATen/core/op_registration/infer_schema.h>
6564
#if defined(EXPOSE_C2_OPS) || !defined(CAFFE2_IS_XPLAT_BUILD)

0 commit comments

Comments
 (0)