| 11 | DurationPredictorModule::DurationPredictorModule(DurationPredictorConfig config) : config_(config) {} |
| 12 | |
| 13 | core::TensorValue DurationPredictorModule::build( |
| 14 | core::ModuleBuildContext & ctx, |
| 15 | const core::TensorValue & input, |
| 16 | const DurationPredictorWeights & weights) const { |
| 17 | auto x = tensor_layout::swap_channel_time_axes_3d(ctx, input); |
| 18 | x = Conv1dModule({config_.hidden_size, config_.channels, 3, 1, 1, 1, config_.use_bias}).build(ctx, x, weights.conv1); |
| 19 | x = ReluModule().build(ctx, x); |
| 20 | x = Conv1dModule({config_.channels, config_.channels, 3, 1, 1, 1, config_.use_bias}).build(ctx, x, weights.conv2); |
| 21 | x = ReluModule().build(ctx, x); |
| 22 | x = Conv1dModule({config_.channels, 1, 1, 1, 0, 1, config_.use_bias}).build(ctx, x, weights.proj); |
| 23 | x = core::wrap_tensor(ggml_cont(ctx.ggml, x.tensor), x.shape, x.type); |
| 24 | return core::reshape_tensor(ctx, x, core::TensorShape::from_dims({input.shape.dims[0], input.shape.dims[1]})); |
| 25 | } |
| 26 | |
| 27 | VariancePredictorModule::VariancePredictorModule(DurationPredictorConfig config) : config_(config) {} |
| 28 |
nothing calls this directly
no test coverage detected