MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / record_temp_memory_allocation

Method record_temp_memory_allocation

tensorflow/core/framework/op_kernel.cc:1001–1011  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

999}
1000
1001void 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
1013int64 OpKernelContext::temp_memory_allocated() const {
1014 mutex_lock l(stats_mu_);

Callers

nothing calls this directly

Calls 4

tensor_dataMethod · 0.80
resetMethod · 0.45
emplace_backMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected