| 145 | } |
| 146 | |
| 147 | engine::core::TensorValue make_i32(const engine::core::TensorShape & shape) { |
| 148 | return engine::core::make_tensor(ctx, GGML_TYPE_I32, shape); |
| 149 | } |
| 150 | |
| 151 | void allocate_tensors() { |
| 152 | if (buffer != nullptr) { |
| 153 | return; |
| 154 | } |
| 155 | buffer = ggml_backend_alloc_ctx_tensors(ggml, backend); |
| 156 | if (buffer == nullptr) { |
| 157 | throw std::runtime_error("failed to allocate test backend tensors"); |
| 158 | } |
no test coverage detected