Fix dll linkage for tensor type ids (#20547)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/20547

-

Differential Revision: D15359988

fbshipit-source-id: 680115a6b73f64c9b02f86eccb8feb799adc6c90
This commit is contained in:
Sebastian Messmer
2019-05-20 16:22:06 -07:00
committed by Facebook Github Bot
parent 410c7210db
commit be1f83c350

View File

@ -87,13 +87,13 @@ inline c10::TensorTypeId TensorTypeIdRegistrar::id() const noexcept {
return id_;
}
#define C10_DECLARE_TENSOR_TYPE(TensorName) \
#define C10_DECLARE_TENSOR_TYPE(TensorName) \
C10_API ::c10::TensorTypeId TensorName()
#define C10_DEFINE_TENSOR_TYPE(TensorName) \
::c10::TensorTypeId TensorName() { \
#define C10_DEFINE_TENSOR_TYPE(TensorName) \
C10_EXPORT ::c10::TensorTypeId TensorName() { \
static ::c10::TensorTypeIdRegistrar registration_raii; \
return registration_raii.id(); \
return registration_raii.id(); \
}
C10_DECLARE_TENSOR_TYPE(UndefinedTensorId);