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

Function graph_linear

src/framework/audio/zipenhancer.cpp:379–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379core::TensorValue graph_linear(
380 core::ModuleBuildContext & ctx,
381 const core::TensorValue & input,
382 const std::unordered_map<std::string, Param> & params,
383 const std::string & prefix,
384 int64_t out_features) {
385 const std::string weight_name = prefix + ".weight";
386 const std::string bias_name = prefix + ".bias";
387 const auto & weight = require_param(params, weight_name);
388 const auto & bias = require_param(params, bias_name);
389 return modules::LinearModule({input.shape.last_dim(), out_features, true}).build(
390 ctx,
391 input,
392 modules::LinearWeights{graph_param(weight), graph_param(bias)});
393}
394
395core::TensorValue graph_add(core::ModuleBuildContext & ctx, const core::TensorValue & lhs, const core::TensorValue & rhs) {
396 return modules::AddModule().build(ctx, lhs, rhs);

Callers 5

graph_attention_weightsFunction · 0.70
graph_self_attentionFunction · 0.70
graph_feed_forwardFunction · 0.70
graph_nonlin_attentionFunction · 0.70
graph_conv_moduleFunction · 0.70

Calls 4

LinearModuleClass · 0.85
graph_paramFunction · 0.85
last_dimMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected