MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / require_f32

Method require_f32

src/framework/assets/tensor_source.cpp:371–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369 const int64_t count = static_cast<int64_t>(values.size());
370 const int64_t chunks = (count + kF32ConvertChunkElements - 1) / kF32ConvertChunkElements;
371 #pragma omp parallel for schedule(static)
372 for (int64_t chunk = 0; chunk < chunks; ++chunk) {
373 const int64_t offset = chunk * kF32ConvertChunkElements;
374 const int64_t length = std::min(kF32ConvertChunkElements, count - offset);
375 ggml_fp32_to_bf16_row(values.data() + offset, converted.data() + offset, length);
376 }
377 set_tensor_bytes(tensor, converted.data(), converted.size() * sizeof(ggml_bf16_t), name);
378 if (retained_bytes) {
379 const auto * begin = reinterpret_cast<const std::byte *>(converted.data());
380 retained_bytes->assign(begin, begin + converted.size() * sizeof(ggml_bf16_t));
381 }

Callers 12

load_weight_norm_conv1dFunction · 0.45
load_activationFunction · 0.45
load_from_safetensorsMethod · 0.45
load_conv1dFunction · 0.45
load_conv_transpose1dFunction · 0.45
load_linearFunction · 0.45
load_snakeFunction · 0.45
read_f32_tensorFunction · 0.45
load_conv1dFunction · 0.45

Calls 5

validate_expected_shapeFunction · 0.85
decode_tensor_data_f32Function · 0.85
shape_from_dimsFunction · 0.85

Tested by

no test coverage detected