| 730 | }; |
| 731 | |
| 732 | AdaNormParts adaptive_block_parts( |
| 733 | core::ModuleBuildContext & ctx, |
| 734 | const core::TensorValue & timestep_mod, |
| 735 | const core::TensorValue & scale_shift_table, |
| 736 | int64_t tokens, |
| 737 | int64_t hidden_size) { |
| 738 | const int64_t batch = timestep_mod.shape.dims[0]; |
| 739 | auto scale_shift = core::reshape_tensor(ctx, scale_shift_table, core::TensorShape::from_dims({1, 6, hidden_size})); |
| 740 | scale_shift = modules::RepeatModule({core::TensorShape::from_dims({batch, 6, hidden_size})}).build(ctx, scale_shift); |
| 741 | auto parts = modules::AddModule{}.build( |
| 742 | ctx, |
| 743 | core::reshape_tensor( |
| 744 | ctx, |
| 745 | core::ensure_backend_addressable_layout(ctx, timestep_mod), |
| 746 | core::TensorShape::from_dims({batch, 6, hidden_size})), |
| 747 | scale_shift); |
no test coverage detected