| 149 | } |
| 150 | |
| 151 | void NodeExecStatsWrapper::SetMemory(OpKernelContext* ctx) { |
| 152 | for (const auto& allocator_pair : ctx->ConsumeWrappedAllocators()) { |
| 153 | AddAllocation(allocator_pair.first, allocator_pair.second); |
| 154 | } |
| 155 | auto* ms = stats_->mutable_memory_stats(); |
| 156 | ms->set_temp_memory_size(ctx->temp_memory_allocated()); |
| 157 | for (const auto& alloc_id : ctx->persistent_alloc_ids()) { |
| 158 | ms->mutable_persistent_tensor_alloc_ids()->Add(alloc_id); |
| 159 | } |
| 160 | ms->set_persistent_memory_size(ctx->persistent_memory_allocated()); |
| 161 | } |
| 162 | |
| 163 | void NodeExecStatsWrapper::SetOutput(int slot, const Tensor* tensor) { |
| 164 | DCHECK(tensor); |
no test coverage detected