| 568 | shape_cursor + static_cast<size_t>(tensor_rank) > gguf_get_arr_n(gguf, shapes_key)) { |
| 569 | throw std::runtime_error("GGUF contains invalid exact tensor dimensions"); |
| 570 | } |
| 571 | if (tensor_rank > 0) { |
| 572 | info.shape.assign(shapes + shape_cursor, shapes + shape_cursor + tensor_rank); |
| 573 | } else { |
| 574 | info.shape.clear(); |
| 575 | } |
| 576 | shape_cursor += static_cast<size_t>(tensor_rank); |
| 577 | } else { |
| 578 | const int dimensions = ggml_n_dims(tensor); |
| 579 | info.shape.reserve(static_cast<size_t>(dimensions)); |
| 580 | for (int dim = dimensions - 1; dim >= 0; --dim) { |
no outgoing calls
no test coverage detected