-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtorch_actor.h
More file actions
30 lines (21 loc) · 736 Bytes
/
Copy pathtorch_actor.h
File metadata and controls
30 lines (21 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//
// Created by qzz on 2024/1/14.
//
#ifndef BRIDGE_LEARNING_PLAYCC_TORCH_ACTOR_H_
#define BRIDGE_LEARNING_PLAYCC_TORCH_ACTOR_H_
#include "rela/batch_runner.h"
#include "bridge_lib/bridge_state.h"
#include "rela/prioritized_replay2.h"
namespace ble = bridge_learning_env;
class TorchActor {
public:
TorchActor(const std::shared_ptr<rela::BatchRunner>& runner)
: runner_(runner) {}
[[nodiscard]] rela::TensorDict GetPolicy(const rela::TensorDict& obs);
[[nodiscard]] rela::TensorDict GetBelief(const rela::TensorDict& obs);
private:
std::shared_ptr<rela::BatchRunner> runner_;
rela::FutureReply fut_policy_{};
rela::FutureReply fut_belief_{};
};
#endif //BRIDGE_LEARNING_PLAYCC_TORCH_ACTOR_H_