| 999 | } |
| 1000 | |
| 1001 | void OpKernelContext::record_temp_memory_allocation(int64 size, |
| 1002 | const Tensor& t) { |
| 1003 | mutex_lock l(stats_mu_); |
| 1004 | temp_memory_allocated_ += size; |
| 1005 | if (!temp_tensor_buffer_and_size_) { |
| 1006 | temp_tensor_buffer_and_size_.reset( |
| 1007 | new gtl::InlinedVector<std::pair<const void*, int64>, 2>()); |
| 1008 | } |
| 1009 | temp_tensor_buffer_and_size_->emplace_back( |
| 1010 | static_cast<const void*>(t.tensor_data().data()), size); |
| 1011 | } |
| 1012 | |
| 1013 | int64 OpKernelContext::temp_memory_allocated() const { |
| 1014 | mutex_lock l(stats_mu_); |
nothing calls this directly
no test coverage detected