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

Function GetTensorBufferAlignedSize

oneflow/core/common/tensor_buffer.cpp:27–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25static constexpr size_t kDefaultTensorBufferAlignedSize = 1024;
26
27size_t GetTensorBufferAlignedSize(size_t origin_size, double factor) {
28 static size_t aligned_size =
29 ParseIntegerFromEnv("ONEFLOW_TENSOR_BUFFER_ALIGNED_SIZE", kDefaultTensorBufferAlignedSize);
30 return RoundUp(static_cast<size_t>(origin_size * factor), aligned_size);
31}
32
33size_t GetTensorBufferGrowthSize(size_t origin_size) {
34 static double factor =

Callers 2

Calls 2

ParseIntegerFromEnvFunction · 0.85
RoundUpFunction · 0.85

Tested by

no test coverage detected