Split deserialize from runPythonUdf and remove generatePythonUDFResult (#34496)

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

Differential Revision: D20347469

Test Plan: Imported from OSS

Pulled By: mrshenli

fbshipit-source-id: b832a3a9e2ef61f149175f737b26f65d63bf797b
This commit is contained in:
Shen Li
2020-03-16 18:23:45 -07:00
committed by Facebook GitHub Bot
parent ae0c88d6aa
commit 38b2856c71
3 changed files with 21 additions and 22 deletions

View File

@ -102,17 +102,8 @@ std::shared_ptr<torch::jit::CompilationUnit> PythonRpcHandler::
return jitCompilationUnit_;
}
SerializedPyObj PythonRpcHandler::generatePythonUDFResult(
const SerializedPyObj& serializedPyObj) {
py::object PythonRpcHandler::runPythonUdf(py::object&& pythonUdf) {
PROFILE_GIL_SCOPED_ACQUIRE;
auto pythonUdf = deserialize(serializedPyObj);
return serialize(pyRunFunction_(std::move(pythonUdf)));
}
py::object PythonRpcHandler::runPythonUDF(
const SerializedPyObj& serializedPyObj) {
PROFILE_GIL_SCOPED_ACQUIRE;
auto pythonUdf = deserialize(serializedPyObj);
return pyRunFunction_(std::move(pythonUdf));
}