| 244 | |
| 245 | |
| 246 | void* paddle_get_decoder_state(const std::vector<std::string> &vocabulary, |
| 247 | size_t beam_size, |
| 248 | double cutoff_prob, |
| 249 | size_t cutoff_top_n, |
| 250 | size_t blank_id, |
| 251 | int log_input, |
| 252 | void* scorer) |
| 253 | { |
| 254 | // DecoderState state(vocabulary, beam_size, cutoff_prob, cutoff_top_n, blank_id, log_input, ext_scorer); |
| 255 | Scorer *ext_scorer = NULL; |
| 256 | if (scorer != NULL) { |
| 257 | ext_scorer = static_cast<Scorer *>(scorer); |
| 258 | } |
| 259 | DecoderState* state = new DecoderState(vocabulary, beam_size, cutoff_prob, cutoff_top_n, blank_id, log_input, ext_scorer); |
| 260 | return static_cast<void*>(state); |
| 261 | } |
| 262 | |
| 263 | void paddle_release_state(void* state) { |
| 264 | delete static_cast<DecoderState*>(state); |
nothing calls this directly
no outgoing calls
no test coverage detected