mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Revert "Refactor caching device allocator utils (#130923)"
This reverts commit c45ca8092dddf718563a1a754de798ad25eae1ee. Reverted https://github.com/pytorch/pytorch/pull/130923 on behalf of https://github.com/ZainRizvi due to Sorry but this appears to be causing internal tests to fail with errors like `error: no type named 'DeviceStats' in namespace 'xxx::xxx:xxxAllocator'; did you mean 'DeviceStatus'?` ([comment](https://github.com/pytorch/pytorch/pull/130923#issuecomment-2315730155))
This commit is contained in:
@ -554,10 +554,10 @@ PyObject* THCPModule_memoryStats(PyObject* _unused, PyObject* arg) {
|
||||
TORCH_CHECK(THPUtils_checkLong(arg), "invalid argument to memory_allocated");
|
||||
const auto device_index = THPUtils_unpackDeviceIndex(arg);
|
||||
|
||||
using c10::CachingDeviceAllocator::DeviceStats;
|
||||
using c10::CachingDeviceAllocator::Stat;
|
||||
using c10::CachingDeviceAllocator::StatArray;
|
||||
using c10::CachingDeviceAllocator::StatType;
|
||||
using c10::cuda::CUDACachingAllocator::DeviceStats;
|
||||
using c10::cuda::CUDACachingAllocator::Stat;
|
||||
using c10::cuda::CUDACachingAllocator::StatArray;
|
||||
using c10::cuda::CUDACachingAllocator::StatType;
|
||||
|
||||
const auto statToDict = [](const Stat& stat) {
|
||||
py::dict dict;
|
||||
|
Reference in New Issue
Block a user