Remove _load_return_value from RPC internal.py (#34492)

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/34492

Differential Revision: D20347468

Test Plan: Imported from OSS

Pulled By: mrshenli

fbshipit-source-id: 92388d0d50a08fb895bacacf94c7b5495b4ae2b6
This commit is contained in:
Shen Li
2020-03-09 20:35:26 -07:00
committed by Facebook Github Bot
parent 6d1c4df660
commit 18ef09f5ac
9 changed files with 30 additions and 37 deletions

View File

@ -128,8 +128,11 @@ py::object PyRRef::toHere() {
if (rref_->isPyObj()) {
// python_rpc_handler deserialization will acquires GIL.
auto rfr_values = value.toTuple()->elements();
return PythonRpcHandler::getInstance().deserialize(
auto& pythonRpcHandler = PythonRpcHandler::getInstance();
auto ret = pythonRpcHandler.deserialize(
SerializedPyObj::fromIValues(rfr_values));
pythonRpcHandler.handleException(ret);
return ret;
} else {
// acquiring GIL as torch::jit::toPyObject creates new py::object
// without grabbing the GIL.