| 56 | |
| 57 | auto weights = std::make_shared<HiFTVocoderComponentWeights>(); |
| 58 | weights->runtime_weights = state->component.weights(); |
| 59 | HiFTVocoderComponent component(std::move(weights), execution_context); |
| 60 | component.state_ = std::move(state); |
| 61 | return component; |
| 62 | } |
| 63 | |
| 64 | HiFTVocoderComponent::HiFTVocoderComponent( |
| 65 | std::shared_ptr<const HiFTVocoderComponentWeights> weights, |
| 66 | const engine::core::ExecutionContext & execution_context) |
| 67 | : weights_(std::move(weights)), execution_context_(&execution_context) {} |
| 68 | |
| 69 | const engine::core::BackendConfig & HiFTVocoderComponent::backend() const noexcept { |
| 70 | return execution_context_->config(); |
| 71 | } |
| 72 | |
| 73 | const std::shared_ptr<const HiFTVocoderComponentWeights> & HiFTVocoderComponent::weights() const noexcept { |
| 74 | return weights_; |
| 75 | } |
| 76 | |
| 77 | HiFTVocoderOutputs HiFTVocoderComponent::infer( |
| 78 | const std::vector<float> & speech_feat, |
| 79 | int64_t batch, |
| 80 | int64_t frames, |
| 81 | uint64_t seed, |
| 82 | uint64_t prior_noise_values, |
| 83 | const std::vector<float> & cache_source) const { |
no test coverage detected