| 98 | } |
| 99 | } |
| 100 | return out; |
| 101 | } |
| 102 | |
| 103 | modules::Conv1dWeights load_weight_norm_conv1d( |
| 104 | core::BackendWeightStore & store, |
| 105 | const assets::TensorSource & source, |
| 106 | const std::string & prefix, |
| 107 | assets::TensorStorageType storage_type, |
| 108 | int64_t out_channels, |
| 109 | int64_t in_channels, |
| 110 | int64_t kernel_size, |
| 111 | bool use_bias = true) { |
| 112 | modules::Conv1dWeights weights; |
| 113 | const auto shape = core::TensorShape::from_dims({out_channels, in_channels, kernel_size}); |
| 114 | weights.weight = store.make_from_f32( |
| 115 | shape, |
| 116 | storage_type, |
| 117 | effective_weight_norm_dim0(source, prefix, {out_channels, in_channels, kernel_size})); |
| 118 | if (use_bias) { |
| 119 | weights.bias = store.load_f32_tensor(source, prefix + ".bias", {out_channels}); |
| 120 | } |
| 121 | return weights; |
| 122 | } |
no test coverage detected