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

Function load_linear

src/models/stable_audio/rf_dit.cpp:46–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44};
45
46modules::LinearWeights load_linear(
47 core::BackendWeightStore & store,
48 const assets::TensorSource & source,
49 const std::string & prefix,
50 assets::TensorStorageType storage_type,
51 int64_t out_features,
52 int64_t in_features,
53 bool use_bias) {
54 modules::LinearWeights weights;
55 weights.weight = store.load_tensor(source, prefix + ".weight", storage_type, {out_features, in_features});
56 if (use_bias) {
57 weights.bias = store.load_f32_tensor(source, prefix + ".bias", {out_features});
58 }
59 return weights;
60}
61
62modules::LinearWeights load_linear_as_shape(
63 core::BackendWeightStore & store,

Callers 5

load_self_attentionFunction · 0.70
load_cross_attentionFunction · 0.70
load_feed_forwardFunction · 0.70
load_layerFunction · 0.70

Calls 2

load_tensorMethod · 0.80
load_f32_tensorMethod · 0.80

Tested by

no test coverage detected