| 65 | } |
| 66 | |
| 67 | Conv1dWeights load_conv1d( |
| 68 | core::BackendWeightStore & store, |
| 69 | const assets::TensorSource & source, |
| 70 | const std::string & prefix, |
| 71 | int64_t out_channels, |
| 72 | int64_t in_channels, |
| 73 | int64_t kernel, |
| 74 | int64_t stride, |
| 75 | int64_t padding, |
| 76 | int64_t dilation, |
| 77 | bool use_bias, |
| 78 | assets::TensorStorageType storage_type) { |
| 79 | (void) storage_type; |
| 80 | Conv1dWeights conv; |
| 81 | conv.out_channels = out_channels; |
| 82 | conv.in_channels = in_channels; |
| 83 | conv.kernel = kernel; |
| 84 | conv.stride = stride; |
| 85 | conv.padding = padding; |
| 86 | conv.dilation = dilation; |
| 87 | conv.use_bias = use_bias; |
| 88 | conv.weight = source.require_f32(prefix + ".weight", {out_channels, in_channels, kernel}); |
| 89 | conv.weight_tensor = store.make_from_f32( |
| 90 | core::TensorShape::from_dims({out_channels, in_channels, kernel}), |
| 91 | assets::TensorStorageType::F32, |
| 92 | conv.weight); |
| 93 | if (use_bias) { |
| 94 | conv.bias = source.require_f32(prefix + ".bias", {out_channels}); |
| 95 | conv.bias_tensor = store.make_from_f32(core::TensorShape::from_dims({out_channels}), assets::TensorStorageType::F32, conv.bias); |
| 96 | } |
| 97 | return conv; |
| 98 | } |
| 99 | |
| 100 | ConvTranspose1dWeights load_conv_transpose1d( |
| 101 | core::BackendWeightStore & store, |
no test coverage detected