hunk.code_window: def ppo_surrogate_loss(policy, model, dist_class, train_batch):
       logits, state = model.from_batch(train_batch)
       action_dist = dist_class(logits, model)
       if state:
           max_seq_len = torch.max(train_batch["seq_lens"])
           mask = sequence_mask(train_batch["seq_lens"], max_seq_len)
           mask = torch.reshape(mask, [-1])
  
hunk.labels: keep keep keep add keep keep keep keep
hunk.after_edit:     mask = None
  
hunk.file_path: rllib/agents/ppo/ppo_torch_policy.py
hunk.type: add
file: #ifndef RAY_GCS_WORKER_INFO_HANDLER_IMPL_H
  #define RAY_GCS_WORKER_INFO_HANDLER_IMPL_H
  
  #include "ray/gcs/redis_gcs_client.h"
  #include "ray/rpc/gcs_server/gcs_rpc_server.h"
  
  namespace ray {
  namespace rpc {
  
  /// This implementation class of `WorkerInfoHandler`.
  class DefaultWorkerInfoHandler : public rpc::WorkerInfoHandler {
   public:
    explicit DefaultWorkerInfoHandler(gcs::RedisGcsClient &gcs_client)
        : gcs_client_(gcs_client) {}
  
    void HandleReportWorkerFailure(const ReportWorkerFailureRequest &request,
                                   ReportWorkerFailureReply *reply,
                                   SendReplyCallback send_reply_callback) override;
  
   private:
    gcs::RedisGcsClient &gcs_client_;
  };
  
  }  // namespace rpc
  }  // namespace ray
  
  #endif  // RAY_GCS_WORKER_INFO_HANDLER_IMPL_H
  