Free scratch memory in ~BaseGPUDevice.
authorA. Unique TensorFlower <gardener@tensorflow.org>
Fri, 27 Apr 2018 01:03:50 +0000 (18:03 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Fri, 27 Apr 2018 01:06:25 +0000 (18:06 -0700)
PiperOrigin-RevId: 194483351

tensorflow/core/common_runtime/gpu/gpu_device.cc

index 1fa3399..944f0c8 100644 (file)
@@ -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();
 }