diff --git a/paddle/fluid/platform/device_context.cc b/paddle/fluid/platform/device_context.cc index d0a108f905f46135bcd2b68be19ab396ab897272..5444fe3175f0bc585b5ea8ce7a8fd9f610b41a52 100644 --- a/paddle/fluid/platform/device_context.cc +++ b/paddle/fluid/platform/device_context.cc @@ -127,9 +127,7 @@ class EigenCudaStreamDevice : public Eigen::StreamInterface { return retv; } - void deallocate(void* buffer) const override { - allocations_.erase(allocations_.find(buffer)); - } + void deallocate(void* buffer) const override { allocations_.erase(buffer); } void* scratchpad() const override { if (scratch_ == NULL) {