From 0a1d311a40009f0663aa3d904fb8574ff13fa672 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Thu, 26 Apr 2018 18:03:50 -0700 Subject: [PATCH] Free scratch memory in ~BaseGPUDevice. PiperOrigin-RevId: 194483351 --- tensorflow/core/common_runtime/gpu/gpu_device.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/tensorflow/core/common_runtime/gpu/gpu_device.cc b/tensorflow/core/common_runtime/gpu/gpu_device.cc index 1fa3399..944f0c8 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_device.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_device.cc @@ -266,6 +266,7 @@ BaseGPUDevice::BaseGPUDevice(const SessionOptions& options, const string& name, BaseGPUDevice::~BaseGPUDevice() { delete gpu_device_info_; + for (auto sb : scratch_) gpu_allocator_->DeallocateRaw(sb); for (auto ctx : device_contexts_) ctx->Unref(); } -- 2.7.4