| 135 | } |
| 136 | |
| 137 | int logical_axis_to_ggml_axis(size_t rank, int logical_axis) { |
| 138 | if (logical_axis < 0 || logical_axis >= static_cast<int>(rank)) { |
| 139 | throw std::runtime_error("Logical axis out of range"); |
| 140 | } |
| 141 | return static_cast<int>(rank) - 1 - logical_axis; |
| 142 | } |
| 143 | |
| 144 | TensorValue wrap_tensor(ggml_tensor * tensor, const TensorShape & shape, ggml_type type) { |
| 145 | if (tensor == nullptr) { |
no outgoing calls
no test coverage detected