MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / DecreasePoolSizeByBase

Method DecreasePoolSizeByBase

oneflow/core/common/tensor_buffer.cpp:278–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278void TensorBufferPool::DecreasePoolSizeByBase(size_t base) {
279 std::unique_lock<std::mutex> lck(mtx_);
280 size_t dec = GetTensorBufferPoolSize(base);
281 CHECK_GE(pool_size_, dec) << "pool_size " << pool_size_ << " decreased by " << dec
282 << " would be negative";
283 pool_size_ -= dec;
284 if (pool_size_ > global_free_list_.capacity()) { global_free_list_.reserve(pool_size_); }
285 if (pool_size_ < global_free_list_.size()) { global_free_list_.resize(pool_size_); }
286}
287
288} // namespace oneflow

Callers 3

~OFRecordDataReaderMethod · 0.80
~COCODataReaderMethod · 0.80

Calls 4

GetTensorBufferPoolSizeFunction · 0.85
capacityMethod · 0.80
sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected