| 127 | } |
| 128 | |
| 129 | void HashTable::AddTensible( |
| 130 | TensibleVariable* tensor, std::function<void(Status)> done) { |
| 131 | tensor->Ref(); |
| 132 | AddTask([this, done, tensor] { |
| 133 | tensor->Resize(size_, [this, tensor, done] (Status st) { |
| 134 | if (st.ok()) { |
| 135 | tensors_.push_back(tensor); |
| 136 | } |
| 137 | done(st); |
| 138 | RunNext(); |
| 139 | }); |
| 140 | }); |
| 141 | } |
| 142 | |
| 143 | HashTable::~HashTable() { |
| 144 | for (auto tensor : tensors_) { |