mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Fix gradient refcounts in pybind and compiled autograd (#118817)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/118817 Approved by: https://github.com/jansel
This commit is contained in:
committed by
PyTorch MergeBot
parent
d85631b721
commit
8e14e1d514
@ -762,9 +762,7 @@ py::object invokeOperatorFromPython(
|
||||
py::args args,
|
||||
const py::kwargs& kwargs,
|
||||
c10::optional<c10::DispatchKey> dk) {
|
||||
auto opWithStack = getOpWithStack(operations, args, kwargs);
|
||||
std::shared_ptr<Operator> found_op = std::get<0>(opWithStack);
|
||||
Stack stack = std::get<1>(opWithStack);
|
||||
auto [found_op, stack] = getOpWithStack(operations, args, kwargs);
|
||||
{
|
||||
pybind11::gil_scoped_release no_gil_guard;
|
||||
if (dk) {
|
||||
|
Reference in New Issue
Block a user