| 717 | } |
| 718 | |
| 719 | core::TensorValue tokenizer_block( |
| 720 | core::ModuleBuildContext & ctx, |
| 721 | const core::TensorValue & input, |
| 722 | const VibeVoiceTokenizerBlockWeights & weights, |
| 723 | core::ConstantTensorCache & constants, |
| 724 | float eps) { |
| 725 | auto residual = input; |
| 726 | auto hidden = channel_rms_norm(ctx, input, weights.norm, constants, eps); |
| 727 | hidden = sconv_depthwise1d(ctx, hidden, weights.mixer, 1); |
| 728 | hidden = scale_channels(ctx, hidden, weights.gamma, constants); |
| 729 | hidden = modules::AddModule{}.build(ctx, residual, hidden); |
| 730 | |
| 731 | residual = hidden; |
| 732 | hidden = channel_rms_norm(ctx, hidden, weights.ffn_norm, constants, eps); |
| 733 | hidden = modules::TransposeModule({{0, 2, 1, 3}, 3}).build(ctx, hidden); |
| 734 | hidden = linear(ctx, hidden, weights.ffn_linear1); |
| 735 | hidden = modules::GeluModule({modules::GeluApproximation::ExactErf}).build(ctx, hidden); |
| 736 | hidden = linear(ctx, hidden, weights.ffn_linear2); |
| 737 | hidden = modules::TransposeModule({{0, 2, 1, 3}, 3}).build(ctx, hidden); |
| 738 | hidden = scale_channels(ctx, hidden, weights.ffn_gamma, constants); |
| 739 | return modules::AddModule{}.build(ctx, residual, hidden); |
| 740 | } |
| 741 | |
| 742 | core::TensorValue tokenizer_block_streaming( |
| 743 | core::ModuleBuildContext & ctx, |
no test coverage detected