mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Use pybind11::gil_scoped_* functions instead of AutoGIL/AutoNoGIL (#30274)
Summary: Reland of https://github.com/pytorch/pytorch/pull/29095 Pull Request resolved: https://github.com/pytorch/pytorch/pull/30274 Differential Revision: D18762293 Pulled By: ezyang fbshipit-source-id: d3d50c2dd12bcb678ab25fa708eb6587cc4b66f9
This commit is contained in:
committed by
Facebook Github Bot
parent
6deb41c88d
commit
1111a6b810
@ -10,7 +10,7 @@
|
||||
#include <torch/csrc/autograd/python_variable.h>
|
||||
#include <torch/csrc/autograd/python_hook.h>
|
||||
#include <torch/csrc/autograd/python_anomaly_mode.h>
|
||||
#include <torch/csrc/utils/auto_gil.h>
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <torch/csrc/utils/python_strings.h>
|
||||
#include <torch/csrc/DynamicTypes.h>
|
||||
#include <torch/csrc/Exceptions.h>
|
||||
@ -48,7 +48,7 @@ PyObject* THPCppFunction_call(PyObject* self, PyObject* args, PyObject *kwargs)
|
||||
variable_list output;
|
||||
|
||||
HANDLE_TH_ERRORS {
|
||||
AutoNoGIL nogil;
|
||||
pybind11::gil_scoped_release nogil;
|
||||
output = (*((THPCppFunction*)self)->cdata)(std::move(vars));
|
||||
}
|
||||
END_HANDLE_TH_ERRORS
|
||||
|
Reference in New Issue
Block a user