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

Method TensorBufferPool

oneflow/core/common/tensor_buffer.cpp:212–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210} // namespace
211
212TensorBufferPool::TensorBufferPool()
213 : thread_local_cache_size_(GetTensorBufferPoolThreadLocalCacheSize()),
214 pool_size_(GetTensorBufferPoolSize()) {
215 auto& thread_local_cache = ThreadLocalCache();
216 thread_local_cache.reserve(thread_local_cache_size_);
217 global_free_list_.reserve(pool_size_);
218}
219
220void TensorBufferPool::Allocate(ItemT* item, const Shape& shape, DataType dtype) {
221 CHECK(!(*item)) << "TensorBuffer is already allocated";

Callers

nothing calls this directly

Tested by

no test coverage detected