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

Function linear_from_source

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

Source from the content-addressed store, hash-verified

281 return bias.has_value() ? conv_transpose1d_data(store, weight, *bias) : conv_transpose1d_data(store, weight);
282}
283
284template <typename Store>
285LinearWeights linear_from_source(
286 Store & store,
287 const assets::TensorSource & source,
288 const std::string & prefix,
289 assets::TensorStorageType storage_type,
290 int64_t out_features,
291 int64_t in_features,
292 bool use_bias) {
293 LinearWeights weights;
294 weights.weight = store.load_tensor(source, prefix + ".weight", storage_type, {out_features, in_features});
295 if (use_bias) {
296 weights.bias = store.load_f32_tensor(source, prefix + ".bias", {out_features});
297 }
298 return weights;
299}
300

Callers 12

linear_weightsFunction · 0.85
load_weightsFunction · 0.85
load_mel_band_weightsFunction · 0.85
load_conformer_layerFunction · 0.85
load_transformer_layerFunction · 0.85
load_ar_weightsFunction · 0.85
load_fm_weightsFunction · 0.85
load_vocoder_weightsFunction · 0.85
load_whisper_weightsFunction · 0.85

Calls 2

load_tensorMethod · 0.80
load_f32_tensorMethod · 0.80

Tested by

no test coverage detected