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

Function flow_mlp

src/models/heartmula/codec.cpp:834–845  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

832 normed = modules::AddModule{}.build(
833 ctx,
834 modules::MulModule{}.build(ctx, normed, add_one(ctx, parts.scale_mlp)),
835 parts.shift_mlp);
836 auto mlp = flow_mlp(ctx, normed, weights, hidden_size);
837 return modules::AddModule{}.build(ctx, x, modules::MulModule{}.build(ctx, parts.gate_mlp, mlp));
838}
839
840core::TensorValue final_layer_norm_modulation(
841 core::ModuleBuildContext & ctx,
842 const core::TensorValue & input,
843 const core::TensorValue & embedded_timestep,
844 const core::TensorValue & scale_shift_table,
845 int64_t hidden_size) {
846 const int64_t batch = input.shape.dims[0];
847 const int64_t frames = input.shape.dims[1];
848 auto table = core::reshape_tensor(ctx, scale_shift_table, core::TensorShape::from_dims({1, 2, hidden_size}));

Callers 1

flow_transformer_blockFunction · 0.85

Calls 2

LinearModuleClass · 0.85
buildMethod · 0.45

Tested by

no test coverage detected