| 31 | } |
| 32 | |
| 33 | void TensorGenerator::Produce() { |
| 34 | Ref(); |
| 35 | spin_rd_lock l(&spin_mu_); |
| 36 | producer_([this] (Status st, const Tensor& result) { |
| 37 | Enque(st, result); |
| 38 | Unref(); |
| 39 | }); |
| 40 | } |
| 41 | |
| 42 | void TensorGenerator::Enque(Status st, const Tensor& tensor) { |
| 43 | std::function<void(Status, const Tensor&)> done = nullptr; |