| 61 | } |
| 62 | |
| 63 | std::vector<float> require_channel_param( |
| 64 | const std::shared_ptr<const engine::assets::TensorSource> & source, |
| 65 | const std::string & name) { |
| 66 | const auto tensor = source->require_f32_tensor(name); |
| 67 | if (tensor.shape.rank != 3 || tensor.shape.dims[0] != 1 || |
| 68 | tensor.shape.dims[1] != kFlashSrChannels || tensor.shape.dims[2] != 1) { |
| 69 | throw std::runtime_error("FlashSR tensor shape mismatch for " + name + ": " + shape_string(tensor)); |
| 70 | } |
| 71 | return tensor.values; |
| 72 | } |
| 73 | |
| 74 | std::string conv_weight_name(const std::string & block_id, int group, int index) { |
| 75 | return "resblocks." + block_id + ".convs" + std::to_string(group) + "." + |
no test coverage detected