1 #ifndef TH_GENERIC_FILE 2 #define TH_GENERIC_FILE "torch/csrc/generic/utils.h" 5 #if defined(THD_GENERIC_FILE) || defined(TH_REAL_IS_HALF) 6 #define GENERATE_SPARSE 0 8 #define GENERATE_SPARSE 1 14 typedef class THPPointer<THWStorage> THWStoragePtr;
15 typedef class THPPointer<THWTensor> THWTensorPtr;
18 #if (!defined(THC_GENERIC_FILE)) && \ 19 (!defined(THD_GENERIC_FILE)) 21 struct THPUtils_typeTraits<scalar_t> {
22 #if defined(TH_REAL_IS_FLOAT) || defined(TH_REAL_IS_DOUBLE) || \ 23 defined(THC_REAL_IS_FLOAT) || defined(THC_REAL_IS_DOUBLE) || \ 24 defined(THC_REAL_IS_HALF) 25 static constexpr
char *python_type_str =
"float";
27 static constexpr
char *python_type_str =
"int";
32 #undef GENERATE_SPARSE