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

Function conv2d_from_source

include/engine/framework/modules/weight_binding.h:342–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

340ConvTranspose1dWeights 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
344template <typename Store>
345LinearWeights 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
361template <typename Store>

Callers 2

load_weightsFunction · 0.85

Calls 2

load_tensorMethod · 0.80
load_f32_tensorMethod · 0.80

Tested by

no test coverage detected