class_docstr: Beam search implementation.
docstr: Merge scores for new hypothesis.
  
  Args:
      prev_scores (Dict[str, float]):
          The previous hypothesis scores by `self.scorers`
      next_full_scores (Dict[str, torch.Tensor]): scores by `self.full_scorers`
      full_idx (int): The next token id for `next_full_scores`
      next_part_scores (Dict[str, torch.Tensor]):
          scores of partial tokens by `self.part_scorers`
      part_idx (int): The new token id for `next_part_scores`
  
  Returns:
      Dict[str, torch.Tensor]: The new score dict.
          Its keys are names of `self.full_scorers` and `self.part_scorers`.
          Its values are scalar tensors by the scorers.
docstr_tok: ["Merge","scores","for","new","hypothesis",".","Args",":","prev_scores","(","Dict","[","str",",","float","]",")",":","The","previous","hypothesis","scores","by","`","self.scorers","`","next_full_scores","(","Dict","[","str",",","torch.Tensor","]",")",":","scores","by","`","self.full_scorers","`","full_idx","(","int",")",":","The","next","token","id","for","`","next_full_scores","`","next_part_scores","(","Dict","[","str",",","torch.Tensor","]",")",":","scores","of","partial","tokens","by","`","self.part_scorers","`","part_idx","(","int",")",":","The","new","token","id","for","`","next_part_scores","`","Returns",":","Dict","[","str",",","torch.Tensor","]",":","The","new","score","dict",".","Its","keys","are","names","of","`","self.full_scorers","`","and","`","self.part_scorers","`",".","Its","values","are","scalar","tensors","by","the","scorers","."]
code: def merge_scores(
      prev_scores: Dict[str, float],
      next_full_scores: Dict[str, torch.Tensor],
      full_idx: int,
      next_part_scores: Dict[str, torch.Tensor],
      part_idx: int,
  ) -> Dict[str, torch.Tensor]:
      """Merge scores for new hypothesis.
  
      Args:
          prev_scores (Dict[str, float]):
              The previous hypothesis scores by `self.scorers`
          next_full_scores (Dict[str, torch.Tensor]): scores by `self.full_scorers`
          full_idx (int): The next token id for `next_full_scores`
          next_part_scores (Dict[str, torch.Tensor]):
              scores of partial tokens by `self.part_scorers`
          part_idx (int): The new token id for `next_part_scores`
  
      Returns:
          Dict[str, torch.Tensor]: The new score dict.
              Its keys are names of `self.full_scorers` and `self.part_scorers`.
              Its values are scalar tensors by the scorers.
  
      """
      new_scores = dict()
      for k, v in next_full_scores.items():
          new_scores[k] = prev_scores[k] + v[full_idx]
      for k, v in next_part_scores.items():
          new_scores[k] = prev_scores[k] + v[part_idx]
      return new_scores
  
imports: import logging
  from itertools import chain
  from typing import Any, Dict, List, NamedTuple, Tuple, Union
  import torch
  from espnet.nets.e2e_asr_common import end_detect
  from espnet.nets.scorer_interface import PartialScorerInterface, ScorerInterface
label_desc: Use image node_id 8 for calling the BeamSearch obj's underlying member method code with example usage: obj.merge_scores(prev_scores, next_full_scores, full_idx, next_part_scores, part_idx) and returns: new_scores