Beam search operator
Created by: Superjomn
According the design of sequence decoder, a beam search operator is needed.
It takes two inputs:
-
topk_ids
: candidate id set, -
topk_generation_scores
: the scores of the prefixes with the candidates appended. and it has two outputs: -
selected_ids
: the selected candidate id set, -
selected_translation_scores
: the corresponding scores of the selected prefixes with candidates appended.