There was an error while loading. Please reload this page.
1 parent 4d1fbd0 commit 2db5f25Copy full SHA for 2db5f25
paddle/fluid/pybind/imperative.cc
@@ -1909,10 +1909,10 @@ void BindImperative(py::module *m_ptr) {
1909
reinterpret_cast<void *>(data_ptr), 0);
1910
1911
// Reset the memory with device pointer
1912
- std::shared_ptr<memory::allocation::Allocation> holder(
1913
- new memory::allocation::Allocation(
+ std::shared_ptr<memory::allocation::Allocation> holder =
+ std::make_shared<memory::allocation::Allocation>(
1914
cuda_device_pointer, need_allocate_size,
1915
- platform::CUDAPlace(device_id)));
+ platform::CUDAPlace(device_id));
1916
self_tensor->ResetHolderWithType(holder, self_tensor->type());
1917
},
1918
py::arg("device_id") = 0, py::return_value_policy::reference, R"DOC(
0 commit comments