| 338 | } |
| 339 | |
| 340 | const Tensor* Gguf::find(const std::string& name) const { |
| 341 | auto it = tensors_.find(name); |
| 342 | return it == tensors_.end() ? nullptr : &it->second; |
| 343 | } |
| 344 | const Tensor& Gguf::t(const std::string& name) const { |
| 345 | if (const Tensor* p = find(name)) return *p; |
| 346 | throw std::runtime_error("gguf: no tensor " + name); |