1#pragma once
2
3#include <torch/csrc/distributed/rpc/rpc_command_base.h>
4#include <torch/csrc/distributed/rpc/types.h>
5
6namespace torch {
7namespace distributed {
8namespace rpc {
9
10// RPC call representing the response of a Python UDF over RPC.
11class TORCH_API PythonResp final : public RpcCommandBase {
12 public:
13 explicit PythonResp(SerializedPyObj&& serializedPyObj);
14
15 c10::intrusive_ptr<Message> toMessageImpl() && override;
16
17 static std::unique_ptr<PythonResp> fromMessage(const Message& message);
18
19 const SerializedPyObj& serializedPyObj() const;
20
21 private:
22 SerializedPyObj serializedPyObj_;
23};
24
25} // namespace rpc
26} // namespace distributed
27} // namespace torch
28