| 226 | auto embedding = modules::ConcatModule({1}).build(ctx, cos_part, sin_part); |
| 227 | auto temb = modules::LinearModule({256, hidden_size, true, GGML_PREC_F32}).build(ctx, embedding, weights.fc1); |
| 228 | temb = modules::SiluModule{}.build(ctx, temb); |
| 229 | temb = modules::LinearModule({hidden_size, hidden_size, true, GGML_PREC_F32}).build(ctx, temb, weights.fc2); |
| 230 | auto proj_in = modules::SiluModule{}.build(ctx, temb); |
| 231 | auto timestep_proj = |
| 232 | modules::LinearModule({hidden_size, hidden_size * 6, true, GGML_PREC_F32}).build(ctx, proj_in, weights.time_proj); |
| 233 | timestep_proj = core::reshape_tensor( |
| 234 | ctx, |
| 235 | timestep_proj, |
| 236 | core::TensorShape::from_dims({timestep_proj.shape.dims[0], int64_t{6}, hidden_size})); |
| 237 | return TimeEmbeddingOutputs{temb, timestep_proj}; |
| 238 | } |
| 239 | |
| 240 | core::TensorValue build_mlp( |
| 241 | core::ModuleBuildContext & ctx, |
| 242 | const core::TensorValue & input, |
| 243 | const modules::LinearWeights & gate_proj, |
| 244 | const modules::LinearWeights & up_proj, |
no test coverage detected