class_docstr: Partial scorer interface for beam search.
  
  The partial scorer performs scoring when non-partial scorer finished scoring,
  and receives pre-pruned next tokens to score because it is too heavy to score
  all the tokens.
  
  Examples:
       * Prefix search for connectionist-temporal-classification models
           * :class:`espnet.nets.scorers.ctc.CTCPrefixScorer`
class_docstr_tok: ["Partial","scorer","interface","for","beam","search",".","The","partial","scorer","performs","scoring","when","non-partial","scorer","finished","scoring",",","and","receives","pre-pruned","next","tokens","to","score","because","it","is","too","heavy","to","score","all","the","tokens",".","Examples",":","*","Prefix","search","for","connectionist-temporal-classification","models","*",":","class",":","`","espnet.nets.scorers.ctc.CTCPrefixScorer","`"]
docstr: Score new token (required).
  
  Args:
      y (torch.Tensor): 1D prefix token
      next_tokens (torch.Tensor): torch.int64 next token to score
      state: decoder state for prefix tokens
      x (torch.Tensor): The encoder feature that generates ys
  
  Returns:
      tuple[torch.Tensor, Any]:
          Tuple of a score tensor for y that has a shape `(len(next_tokens),)`
          and next state for ys
docstr_tok: ["Score","new","token","(","required",")",".","Args",":","y","(","torch.Tensor",")",":","1D","prefix","token","next_tokens","(","torch.Tensor",")",":","torch.int64","next","token","to","score","state",":","decoder","state","for","prefix","tokens","x","(","torch.Tensor",")",":","The","encoder","feature","that","generates","ys","Returns",":","tuple","[","torch.Tensor",",","Any","]",":","Tuple","of","a","score","tensor","for","y","that","has","a","shape","`","(","len","(","next_tokens",")",",",")","`","and","next","state","for","ys"]
code: def score_partial(
      self,
      y: torch.Tensor,
      next_tokens: torch.Tensor,
      state: Any,
      x: torch.Tensor,
  ) -> Tuple[torch.Tensor, Any]:
      """Score new token (required).
  
      Args:
          y (torch.Tensor): 1D prefix token
          next_tokens (torch.Tensor): torch.int64 next token to score
          state: decoder state for prefix tokens
          x (torch.Tensor): The encoder feature that generates ys
  
      Returns:
          tuple[torch.Tensor, Any]:
              Tuple of a score tensor for y that has a shape `(len(next_tokens),)`
              and next state for ys
  
      """
      raise NotImplementedError
  
file_path: espnet/espnet/nets/scorer_interface.py
imports: import warnings
  from typing import Any, List, Tuple
  import torch
label_desc: Use image node_id 1 for calling the PartialScorerInterface obj's underlying member method code with example usage: obj.score_partial(y, next_tokens, state, x) without return types