mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Explicitly decref in UnpickledPythonCall dtor (#38398)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/38398 Test Plan: Imported from OSS Differential Revision: D21550712 Pulled By: mrshenli fbshipit-source-id: aac4708a5b6f6dc38149f995d11e27c190648859
This commit is contained in:
committed by
Facebook GitHub Bot
parent
876b9591dc
commit
fa4ed17183
@ -125,13 +125,14 @@ std::shared_ptr<torch::jit::CompilationUnit> PythonRpcHandler::
|
||||
return jitCompilationUnit_;
|
||||
}
|
||||
|
||||
py::object PythonRpcHandler::runPythonUdf(py::object&& pythonUdf) {
|
||||
py::object PythonRpcHandler::runPythonUdf(const py::object& pythonUdf) {
|
||||
PROFILE_GIL_SCOPED_ACQUIRE;
|
||||
// Throw a descriptive error message if pyRunFunction_ is already cleaned up.
|
||||
TORCH_INTERNAL_ASSERT_DEBUG_ONLY(
|
||||
!pyRunFunction_.is_none(),
|
||||
"Cannot run python UDF since pyRunFunction_ is None. Check if python RPC handler is already cleaned up.");
|
||||
return pyRunFunction_(std::move(pythonUdf));
|
||||
"Cannot run python UDF since pyRunFunction_ is None. Check if python RPC "
|
||||
"handler is already cleaned up.");
|
||||
return pyRunFunction_(pythonUdf);
|
||||
}
|
||||
|
||||
SerializedPyObj PythonRpcHandler::serialize(const py::object& obj) {
|
||||
|
Reference in New Issue
Block a user