| 340 | ConvTranspose1dWeights conv_transpose1d_data(Store & store, const TensorData & weight, const std::optional<TensorData> & bias) { |
| 341 | return bias.has_value() ? conv_transpose1d_data(store, weight, *bias) : conv_transpose1d_data(store, weight); |
| 342 | } |
| 343 | |
| 344 | template <typename Store> |
| 345 | LinearWeights linear_from_source( |
| 346 | Store & store, |
| 347 | const assets::TensorSource & source, |
| 348 | const std::string & prefix, |
| 349 | assets::TensorStorageType storage_type, |
| 350 | int64_t out_features, |
| 351 | int64_t in_features, |
| 352 | bool use_bias) { |
| 353 | LinearWeights weights; |
| 354 | weights.weight = store.load_tensor(source, prefix + ".weight", storage_type, {out_features, in_features}); |
| 355 | if (use_bias) { |
| 356 | weights.bias = store.load_f32_tensor(source, prefix + ".bias", {out_features}); |
| 357 | } |
| 358 | return weights; |
| 359 | } |
| 360 | |
| 361 | template <typename Store> |
no test coverage detected