| 127 | } |
| 128 | |
| 129 | std::optional<QTensor> check_tensor(const Tensor* tensor, Quant weight_quant, std::array<int, 4> shape, const int debug_line) { |
| 130 | if (tensor == nullptr) { |
| 131 | std::cerr << "FATAL: missing tensor at line " << debug_line << std::endl; |
| 132 | assert(false); |
| 133 | return std::nullopt; |
| 134 | } |
| 135 | return QTensor::from_codec_tensor(*tensor, weight_quant, shape, debug_line); |
| 136 | }; |
| 137 | |
| 138 | const Tensor* get_tensor(const YALMData& yalm, const std::string& key) { |
| 139 | auto it = yalm.tensors.find(key); |