Skip to content

Commit

Permalink
fix ~IpuBackend() quit error (PaddlePaddle#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
XBWGC authored Aug 13, 2021
1 parent 82d4973 commit ff4ba95
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion paddle/fluid/framework/ipu/ipu_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,12 @@ void IpuBackend::AttachDevice(int id) {
}

IpuBackend::~IpuBackend() {
if (instance_ == nullptr) {
return;
}

// detach device
if (curr_device_->isAttached()) {
if (curr_device_ != nullptr && curr_device_->isAttached()) {
curr_device_->detach();
}
}
Expand Down

0 comments on commit ff4ba95

Please sign in to comment.