| 674 | int64_t groups, |
| 675 | const std::optional<core::TensorValue> & time_mask, |
| 676 | const std::optional<core::TensorValue> & inv_valid_group_values) { |
| 677 | auto x = input_bct; |
| 678 | for (const auto & block : weights.blocks) { |
| 679 | x = resnet_block(ctx, x, block, std::min<int64_t>(groups, x.shape.dims[1]), time_mask, inv_valid_group_values); |
| 680 | } |
| 681 | return x; |
| 682 | } |
| 683 | |
| 684 | core::TensorValue snake_beta( |
| 685 | core::ModuleBuildContext & ctx, |
| 686 | const core::TensorValue & input_bct, |
| 687 | const MioCodecSnakeBetaWeights & weights) { |
| 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); |
no test coverage detected