mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Fix CPUCaching allocator guard bug (#46922)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/46922 Earlier bug wrongly captures the previous value to be saved. Test Plan: cpu_caching_allocator_test Reviewed By: dreiss Differential Revision: D24566514 fbshipit-source-id: 734a4c1f810bbec16fe007f31fffa360898955ac
This commit is contained in:
parent
c3fc17b48e
commit
cbf90dafe1
1 changed files with 1 additions and 1 deletions
|
|
@ -95,8 +95,8 @@ CPUCachingAllocator* GetThreadLocalCachingAllocator() {
|
|||
|
||||
WithCPUCachingAllocatorGuard::WithCPUCachingAllocatorGuard(
|
||||
CPUCachingAllocator* allocator) {
|
||||
caching_allocator_ptr = allocator;
|
||||
prev_caching_allocator_ptr_ = GetThreadLocalCachingAllocator();
|
||||
caching_allocator_ptr = allocator;
|
||||
}
|
||||
|
||||
WithCPUCachingAllocatorGuard::~WithCPUCachingAllocatorGuard() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue