@@ -17,7 +17,8 @@ namespace executor {
17
17
Memory::Memory (
18
18
const std::vector<std::string>& pos_embs_path,
19
19
std::vector<std::shared_ptr<Module>>& modules)
20
- : input_tensors_(4 ),
20
+ : data_ptr_(nullptr , [](void *) {}),
21
+ input_tensors_ (4 ),
21
22
output_tensors_ (4 ),
22
23
pos_embs_path_ (pos_embs_path),
23
24
modules_ (modules) {}
@@ -50,7 +51,7 @@ BertMemory::BertMemory(
50
51
const std::vector<std::string>& pos_embs_path,
51
52
std::vector<std::shared_ptr<Module>>& modules)
52
53
: Memory(pos_embs_path, modules) {
53
- data_ptr_ = std::unique_ptr<void , std::function< void ( void *)> >(
54
+ data_ptr_ = std::unique_ptr<void , void (*)( void *)>(
54
55
new IO, [](void * ptr) { delete static_cast <IO*>(ptr); });
55
56
}
56
57
@@ -204,7 +205,7 @@ KVCachedMemory::KVCachedMemory(
204
205
const std::vector<std::string>& pos_embs_path,
205
206
std::vector<std::shared_ptr<Module>>& modules)
206
207
: Memory(pos_embs_path, modules) {
207
- data_ptr_ = std::unique_ptr<void , std::function< void ( void *)> >(
208
+ data_ptr_ = std::unique_ptr<void , void (*)( void *)>(
208
209
new IO, [](void * ptr) { delete static_cast <IO*>(ptr); });
209
210
futures_ = std::vector<std::future<void >>(thread_pool_.num_workers ());
210
211
}
0 commit comments