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

Function load_linear

src/models/stable_audio/same_autoencoder.cpp:65–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 void operator()(ggml_context * ctx) const noexcept {
64 if (ctx != nullptr) {
65 ggml_free(ctx);
66 }
67 }
68};
69
70modules::LinearWeights load_linear(
71 core::BackendWeightStore & store,
72 const assets::TensorSource & source,
73 const std::string & prefix,
74 assets::TensorStorageType storage_type,
75 int64_t out_features,
76 int64_t in_features,
77 bool use_bias) {
78 modules::LinearWeights weights;
79 weights.weight = store.load_tensor(source, prefix + ".weight", storage_type, {out_features, in_features});
80 if (use_bias) {
81 weights.bias = store.load_f32_tensor(source, prefix + ".bias", {out_features});
82 }

Callers 3

load_same_attentionFunction · 0.70
load_same_ffFunction · 0.70

Calls 2

load_tensorMethod · 0.80
load_f32_tensorMethod · 0.80

Tested by

no test coverage detected