| 688 | auto input = core::ensure_backend_addressable_layout(ctx, input_bct); |
| 689 | auto alpha = core::reshape_tensor(ctx, weights.alpha, core::TensorShape::from_dims({1, input_bct.shape.dims[1], 1})); |
| 690 | auto inv_beta = core::reshape_tensor(ctx, weights.inv_beta, core::TensorShape::from_dims({1, input_bct.shape.dims[1], 1})); |
| 691 | auto alpha_rep = core::wrap_tensor(ggml_repeat(ctx.ggml, alpha.tensor, input.tensor), input.shape, GGML_TYPE_F32); |
| 692 | auto inv_beta_rep = core::wrap_tensor(ggml_repeat(ctx.ggml, inv_beta.tensor, input.tensor), input.shape, GGML_TYPE_F32); |
| 693 | auto ax = engine::modules::MulModule{}.build(ctx, input, alpha_rep); |
| 694 | ax = core::ensure_backend_addressable_layout(ctx, ax); |
| 695 | auto periodic = core::wrap_tensor(ggml_sqr(ctx.ggml, ggml_sin(ctx.ggml, ax.tensor)), input.shape, GGML_TYPE_F32); |
| 696 | periodic = engine::modules::MulModule{}.build(ctx, periodic, inv_beta_rep); |
| 697 | return core::wrap_tensor(ggml_add(ctx.ggml, input.tensor, periodic.tensor), input.shape, GGML_TYPE_F32); |
| 698 | } |
| 699 | |
| 700 | core::TensorValue upsampler( |
| 701 | core::ModuleBuildContext & ctx, |
| 702 | const core::TensorValue & input_bct, |
| 703 | const MioCodecUpsamplerWeights & weights, |
| 704 | int64_t groups, |
| 705 | const std::vector<core::TensorValue> * stage_time_masks, |
| 706 | const std::vector<core::TensorValue> * stage_inv_valid_group_values) { |
| 707 | auto x = input_bct; |
no test coverage detected