| 281 | return bias.has_value() ? conv_transpose1d_data(store, weight, *bias) : conv_transpose1d_data(store, weight); |
| 282 | } |
| 283 | |
| 284 | template <typename Store> |
| 285 | LinearWeights linear_from_source( |
| 286 | Store & store, |
| 287 | const assets::TensorSource & source, |
| 288 | const std::string & prefix, |
| 289 | assets::TensorStorageType storage_type, |
| 290 | int64_t out_features, |
| 291 | int64_t in_features, |
| 292 | bool use_bias) { |
| 293 | LinearWeights weights; |
| 294 | weights.weight = store.load_tensor(source, prefix + ".weight", storage_type, {out_features, in_features}); |
| 295 | if (use_bias) { |
| 296 | weights.bias = store.load_f32_tensor(source, prefix + ".bias", {out_features}); |
| 297 | } |
| 298 | return weights; |
| 299 | } |
| 300 |
no test coverage detected