Skip to content

Commit

Permalink
fix detach_ bug (PaddlePaddle#57394)
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghuancoder authored and Frida-a committed Oct 14, 2023
1 parent 5f6cfae commit 685997c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion paddle/fluid/pybind/eager_method.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ static PyObject* tensor_method_detach_(TensorObject* self,
autograd_meta->SetPersistable(
egr::EagerUtils::autograd_meta(&(self->tensor))->Persistable());
self->tensor.set_autograd_meta(autograd_meta);

Py_INCREF(reinterpret_cast<PyObject*>(self));
return reinterpret_cast<PyObject*>(self);
EAGER_CATCH_AND_THROW_RETURN_NULL
}
Expand Down

0 comments on commit 685997c

Please sign in to comment.