MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / load_conv2d

Function load_conv2d

src/framework/modules/campplus_encoder.cpp:176–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176CampplusEncoderWeights::Conv2dWeights load_conv2d(
177 core::BackendWeightStore & store,
178 const assets::TensorSource & source,
179 const std::string & prefix,
180 int64_t out_channels,
181 int64_t in_channels,
182 int64_t kernel_h,
183 int64_t kernel_w,
184 int64_t stride_h,
185 int64_t stride_w,
186 int64_t padding_h,
187 int64_t padding_w) {
188 CampplusEncoderWeights::Conv2dWeights conv;
189 conv.out_channels = out_channels;
190 conv.in_channels = in_channels;
191 conv.kernel_h = kernel_h;
192 conv.kernel_w = kernel_w;
193 conv.stride_h = stride_h;
194 conv.stride_w = stride_w;
195 conv.padding_h = padding_h;
196 conv.padding_w = padding_w;
197 conv.weight = read_f32_tensor(source, prefix + ".weight", {out_channels, in_channels, kernel_h, kernel_w});
198 conv.weight_tensor = store.make_from_f32(
199 core::TensorShape::from_dims({out_channels, in_channels, kernel_h, kernel_w}),
200 assets::TensorStorageType::F32,
201 conv.weight);
202 return conv;
203}
204
205CampplusEncoderWeights::Conv1dWeights fold_bn_after_conv1d(
206 core::BackendWeightStore & store,

Callers 1

load_typed_weightsFunction · 0.70

Calls 2

make_from_f32Method · 0.80
read_f32_tensorFunction · 0.70

Tested by

no test coverage detected