How to get the scores of a certain beam

When I attempt to generate with beam + sample, I try to obtain the sequence score.
However, I realize in the generation results, ‘sequences’ contains batch_size number of instances, while ‘scores’ contains batch_size * num_beams instances.
How do I decide the score of the output sequences?