mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
* Remove remaining TensorTypeUtils functions. Mostly what's remaining is copy utilities -- these are now provided in THCTensorCopy.hpp and templatized on the ScalarType rather than the TensorType. * Have a single THTensor / THCTensor type. As was previously done with Storages, have only a single (dtype-independent) THTensor / THCTensor. For documentation and backwards compatibility purposes, the old names, e.g. TH(Cuda)LongTensor alias the new TH(C)Tensor type. * undef GENERATE_SPARSE.
22 lines
353 B
C++
22 lines
353 B
C++
#ifndef TH_GENERIC_FILE
|
|
#define TH_GENERIC_FILE "generic/utils.cpp"
|
|
#else
|
|
|
|
#if defined(THD_GENERIC_FILE) || defined(TH_REAL_IS_HALF)
|
|
#define GENERATE_SPARSE 0
|
|
#else
|
|
#define GENERATE_SPARSE 1
|
|
#endif
|
|
|
|
template<>
|
|
void THPPointer<THPStorage>::free() {
|
|
if (ptr)
|
|
Py_DECREF(ptr);
|
|
}
|
|
|
|
template class THPPointer<THPStorage>;
|
|
|
|
#undef GENERATE_SPARSE
|
|
|
|
#endif
|