mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Apply clang-format to RPC files (#34139)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/34139 Test Plan: Imported from OSS Differential Revision: D20227342 Pulled By: mrshenli fbshipit-source-id: 01b478bde1f6a51f69eb5277fa90ba6ac2d4b5dc
This commit is contained in:
committed by
Facebook Github Bot
parent
3af0dffe84
commit
7da24b36b1
@ -67,8 +67,7 @@ PyRRef::PyRRef(const py::object& value)
|
||||
// that holds an IValue of an pyobject
|
||||
elem_type = PyObjectType::get();
|
||||
}
|
||||
auto rref =
|
||||
RRefContext::getInstance().createOwnerRRef(elem_type);
|
||||
auto rref = RRefContext::getInstance().createOwnerRRef(elem_type);
|
||||
py::object copy(value); // increases refcount
|
||||
IValue ivalue = jit::toIValue(std::move(copy), elem_type);
|
||||
rref->setValue(std::move(ivalue));
|
||||
@ -95,8 +94,7 @@ py::object PyRRef::toHere() {
|
||||
// python_rpc_handler deserialization will acquires GIL.
|
||||
auto rfr_values = value.toTuple()->elements();
|
||||
return PythonRpcHandler::getInstance().deserialize(
|
||||
SerializedPyObj::fromIValues(rfr_values)
|
||||
);
|
||||
SerializedPyObj::fromIValues(rfr_values));
|
||||
} else {
|
||||
// acquiring GIL as torch::jit::toPyObject creates new py::object
|
||||
// without grabbing the GIL.
|
||||
@ -131,8 +129,7 @@ std::string PyRRef::str() const {
|
||||
ss << "OwnerRRef(" << rref_->rrefId() << ")";
|
||||
} else {
|
||||
ss << "UserRRef(RRefId = " << rref_->rrefId() << ", ForkId = "
|
||||
<< c10::static_intrusive_pointer_cast<UserRRef>(rref_)->forkId()
|
||||
<< ")";
|
||||
<< c10::static_intrusive_pointer_cast<UserRRef>(rref_)->forkId() << ")";
|
||||
}
|
||||
return ss.str();
|
||||
}
|
||||
@ -164,7 +161,6 @@ c10::IValue PyRRef::toIValue() {
|
||||
return IValue(rrefPtr);
|
||||
}
|
||||
|
||||
|
||||
} // namespace rpc
|
||||
} // namespace distributed
|
||||
} // namespace torch
|
||||
|
Reference in New Issue
Block a user