From 8b94de06afefbf81029e04ef23c189687bb7103b Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Thu, 21 Mar 2019 14:51:38 -0700 Subject: [PATCH] Allow using C10_DECLARE_TENSOR_TYPE and C10_DEFINE_TENSOR_TYPE from any namespace (#18158) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/18158 They didn't work when called from other namespaces before because they didn't fully specify the c10 namespace. Reviewed By: ezyang Differential Revision: D14512187 fbshipit-source-id: a496b89a1bbe2b56137cfae03ab94a60f38d7068 --- c10/core/TensorTypeIdRegistration.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/c10/core/TensorTypeIdRegistration.h b/c10/core/TensorTypeIdRegistration.h index 1617ea2..dc441af 100644 --- a/c10/core/TensorTypeIdRegistration.h +++ b/c10/core/TensorTypeIdRegistration.h @@ -88,11 +88,11 @@ inline c10::TensorTypeId TensorTypeIdRegistrar::id() const noexcept { } #define C10_DECLARE_TENSOR_TYPE(TensorName) \ - C10_API c10::TensorTypeId TensorName() + C10_API ::c10::TensorTypeId TensorName() #define C10_DEFINE_TENSOR_TYPE(TensorName) \ - c10::TensorTypeId TensorName() { \ - static TensorTypeIdRegistrar registration_raii; \ + ::c10::TensorTypeId TensorName() { \ + static ::c10::TensorTypeIdRegistrar registration_raii; \ return registration_raii.id(); \ } -- 2.7.4