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

Function make_channel_broadcast_shape

src/framework/modules/norm_modules.cpp:144–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142 result = core::wrap_tensor(ggml_mul(ctx.ggml, result.tensor, weight.tensor), result.shape, GGML_TYPE_F32);
143 }
144 if (config.use_bias) {
145 if (!weights.bias.has_value()) {
146 throw std::runtime_error("bias is required when NormConfig.use_bias is true");
147 }
148 core::validate_shape(*weights.bias, core::TensorShape::from_dims({config.hidden_size}), "bias");
149 const auto bias = ensure_f32(ctx, *weights.bias);
150 result = core::wrap_tensor(ggml_add(ctx.ggml, result.tensor, bias.tensor), result.shape, GGML_TYPE_F32);
151 }
152 return result;
153}
154
155void validate_norm_config(const NormConfig & config) {

Callers 2

repeat_channelsFunction · 0.85
buildMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected