| 270 | int64_t plane, |
| 271 | int64_t hidden_size, |
| 272 | int64_t seq_len) { |
| 273 | auto slice = modules::SliceModule({1, plane, 1}).build(ctx, conditioning); |
| 274 | slice = ensure_contiguous(ctx, slice); |
| 275 | slice = core::reshape_tensor( |
| 276 | ctx, |
| 277 | slice, |
| 278 | core::TensorShape::from_dims({conditioning.shape.dims[0], hidden_size})); |
| 279 | return expand_conditioning(ctx, slice, seq_len); |
| 280 | } |
| 281 | |
| 282 | core::TensorValue dit_layer( |
| 283 | core::ModuleBuildContext & ctx, |
| 284 | const core::TensorValue & hidden_states, |
| 285 | const core::TensorValue & positions, |
| 286 | const core::TensorValue & timestep_proj, |
| 287 | const core::TensorValue & one, |
| 288 | const std::optional<core::TensorValue> & self_attention_mask, |
| 289 | const core::TensorValue & encoder_attention_mask, |
| 290 | const AceStepDiTLayerWeights & weights, |
| 291 | const AceStepDiffusionConfig & config, |
| 292 | bool flash_attention, |
| 293 | const std::optional<PrecomputedCrossAttentionKV> & cross_attention_kv, |
| 294 | const std::optional<core::TensorValue> & encoder_hidden_states = std::nullopt) { |
| 295 | const int64_t hidden_size = config.hidden_size; |
| 296 | const int64_t seq_len = hidden_states.shape.dims[1]; |
| 297 | auto scale_shift_table = modules::RepeatModule({timestep_proj.shape}).build(ctx, ensure_f32(ctx, weights.scale_shift_table)); |
no test coverage detected