| 233 | } |
| 234 | |
| 235 | MioCodecConv1dWeights bind_conv1d( |
| 236 | const MioCodecWeights & weights, |
| 237 | const std::string & prefix, |
| 238 | int64_t out_channels, |
| 239 | int64_t in_channels, |
| 240 | int64_t kernel_size, |
| 241 | int stride = 1, |
| 242 | int padding = 0, |
| 243 | int dilation = 1, |
| 244 | bool use_bias = true) { |
| 245 | MioCodecConv1dWeights conv; |
| 246 | conv.config = { |
| 247 | in_channels, |
| 248 | out_channels, |
| 249 | kernel_size, |
| 250 | stride, |
| 251 | padding, |
| 252 | dilation, |
| 253 | use_bias, |
| 254 | }; |
| 255 | conv.weights.weight = require_loaded_tensor(weights, prefix + ".weight", {out_channels, in_channels, kernel_size}); |
| 256 | if (use_bias) { |
| 257 | conv.weights.bias = require_loaded_tensor(weights, prefix + ".bias", {out_channels}); |
| 258 | } |
| 259 | return conv; |
| 260 | } |
| 261 | |
| 262 | MioCodecConvTranspose1dWeights bind_conv_transpose1d( |
| 263 | const MioCodecWeights & weights, |
no outgoing calls
no test coverage detected