| 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 | |
| 840 | core::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})); |
no test coverage detected