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

Function head_dim

src/models/ace_step/text_encoder.cpp:56–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54};
55
56int64_t head_dim(const AceStepTextEncoderConfig & config) {
57 if (config.num_attention_heads <= 0 || config.num_key_value_heads <= 0 || config.head_dim <= 0) {
58 throw std::runtime_error("ACE-Step text encoder attention config is invalid");
59 }
60 if (config.num_attention_heads % config.num_key_value_heads != 0) {
61 throw std::runtime_error("ACE-Step text encoder num_attention_heads must be divisible by num_key_value_heads");
62 }
63 return config.head_dim;
64}
65
66core::TensorValue ensure_contiguous(core::ModuleBuildContext & ctx, const core::TensorValue & input) {
67 return core::ensure_backend_addressable_layout(ctx, input);

Callers 1

decoder_layerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected