| 536 | } |
| 537 | |
| 538 | core::TensorValue build_residual_unit( |
| 539 | core::ModuleBuildContext & ctx, |
| 540 | const core::TensorValue & input, |
| 541 | const ResidualUnitWeights & weights, |
| 542 | int64_t channels, |
| 543 | int dilation) { |
| 544 | auto hidden = build_snake1d_exact_bct(ctx, input, weights.snake1, channels); |
| 545 | auto conv1 = weights.conv1; |
| 546 | conv1.dilation = dilation; |
| 547 | conv1.padding = 3 * dilation; |
| 548 | hidden = build_conv1d(ctx, hidden, conv1, channels, channels, true); |
| 549 | hidden = build_snake1d_exact_bct(ctx, hidden, weights.snake2, channels); |
| 550 | hidden = build_conv1d(ctx, hidden, weights.conv2, channels, channels, true); |
| 551 | return modules::AddModule{}.build(ctx, input, hidden); |
| 552 | } |
| 553 | |
| 554 | int64_t audio_frames_per_latent(const AceStepVAEConfig & config) { |
| 555 | if (config.downsampling_ratios.empty()) { |
no test coverage detected