| 266 | const auto bytes = quantize_f32_rows(name, values, shape, type); |
| 267 | set_tensor_bytes(tensor, bytes.data(), bytes.size(), name); |
| 268 | } |
| 269 | |
| 270 | } // namespace |
| 271 | |
| 272 | void set_backend_tensor_from_f32_parallel( |
| 273 | ggml_tensor * tensor, |
| 274 | std::string_view name, |
| 275 | const std::vector<float> & values, |
| 276 | const core::TensorShape & shape, |
| 277 | ggml_type type) { |
| 278 | if (static_cast<int64_t>(values.size()) < kParallelF32ConvertElements || |
| 279 | (type != GGML_TYPE_F16 && type != GGML_TYPE_BF16)) { |
| 280 | set_backend_tensor_from_f32(tensor, name, values, shape, type); |
| 281 | return; |
| 282 | } |
| 283 | |
| 284 | if (type == GGML_TYPE_F16) { |
| 285 | std::vector<ggml_fp16_t> converted(values.size()); |
| 286 | const int64_t count = static_cast<int64_t>(values.size()); |
no test coverage detected