xref: /aosp_15_r20/external/pytorch/torch/csrc/distributed/autograd/rpc_messages/propagate_gradients_resp.h (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 #pragma once
2 
3 #include <torch/csrc/distributed/rpc/message.h>
4 #include <torch/csrc/distributed/rpc/rpc_command_base.h>
5 
6 namespace torch {
7 namespace distributed {
8 namespace autograd {
9 
10 // Response for the PropagateGradients call. Currently, this class is mostly
11 // just a placeholder and sends an empty message over the wire. The purpose of
12 // this RPC command is to indicate whether or not the PropagateGradientsReq call
13 // was successfully or not.
14 class TORCH_API PropagateGradientsResp : public rpc::RpcCommandBase {
15  public:
16   PropagateGradientsResp() = default;
17   c10::intrusive_ptr<rpc::Message> toMessageImpl() && override;
18   static std::unique_ptr<PropagateGradientsResp> fromMessage(
19       const rpc::Message& message);
20 };
21 
22 } // namespace autograd
23 } // namespace distributed
24 } // namespace torch
25