"docs/vscode:/vscode.git/clone" did not exist on "9dfcd9a5e67c5bbb92c0cde529a55bb12990de07"
Commit f0637eb7 authored by Arnie Yuan's avatar Arnie Yuan Committed by Facebook GitHub Bot
Browse files

Fix global namespace pollution in ATen/Dispatch.h (#13)

Summary:
X-link: https://github.com/facebookexternal/DRTK/pull/2

Pull Request resolved: https://github.com/facebookresearch/DRTK/pull/13

X-link: https://github.com/pytorch/pytorch/pull/138626

Was it a typo? Since we already have `at::detail` in `ATen/Dispatch.h`

Deleting `::detail` all together, we don't need the functions in it anymore.

Reviewed By: malfet

Differential Revision: D64642080

fbshipit-source-id: 9ae48a888a854ec85e1caef53d87e6e3cc81591b
parent 4e833ae7
......@@ -46,9 +46,8 @@ inline int GET_BLOCKS(const int64_t N, const int64_t max_threads_per_block = CUD
// Dispatches for float and double
#define AT_DISPATCH_FLOATING_TYPES(TYPE, NAME, ...) \
[&] { \
const auto& the_type = TYPE; \
const at::ScalarType _st = TYPE; \
/* don't use TYPE again in case it is an expensive or side-effect op */ \
at::ScalarType _st = ::detail::scalar_type(the_type); \
switch (_st) { \
AT_PRIVATE_CASE_TYPE(at::ScalarType::Double, double, __VA_ARGS__) \
AT_PRIVATE_CASE_TYPE(at::ScalarType::Float, float, __VA_ARGS__) \
......@@ -60,9 +59,8 @@ inline int GET_BLOCKS(const int64_t N, const int64_t max_threads_per_block = CUD
// Dispatches for float, double, and half
#define AT_DISPATCH_FLOATING_TYPES_AND_HALF(TYPE, NAME, ...) \
[&] { \
const auto& the_type = TYPE; \
const at::ScalarType _st = TYPE; \
/* don't use TYPE again in case it is an expensive or side-effect op */ \
at::ScalarType _st = ::detail::scalar_type(the_type); \
switch (_st) { \
AT_PRIVATE_CASE_TYPE(at::ScalarType::Double, double, __VA_ARGS__) \
AT_PRIVATE_CASE_TYPE(at::ScalarType::Float, float, __VA_ARGS__) \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment