class_docstr: Decoder interface wrapper for CTCPrefixScore.
class_docstr_tok: ["Decoder","interface","wrapper","for","CTCPrefixScore","."]
docstr: Score new token.
  
  Args:
      y (torch.Tensor): 1D prefix token
      ids (torch.Tensor): torch.int64 next token to score
      state: decoder state for prefix tokens
      x (torch.Tensor): 2D 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",".","Args",":","y","(","torch.Tensor",")",":","1D","prefix","token","ids","(","torch.Tensor",")",":","torch.int64","next","token","to","score","state",":","decoder","state","for","prefix","tokens","x","(","torch.Tensor",")",":","2D","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 batch_score_partial(self, y, ids, state, x):
      """Score new token.
  
      Args:
          y (torch.Tensor): 1D prefix token
          ids (torch.Tensor): torch.int64 next token to score
          state: decoder state for prefix tokens
          x (torch.Tensor): 2D 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
  
      """
      batch_state = (
          (
              torch.stack([s[0] for s in state], dim=2),
              torch.stack([s[1] for s in state]),
              state[0][2],
              state[0][3],
          )
          if state[0] is not None
          else None
      )
      return self.impl(y, batch_state, ids)
  
file_path: espnet/espnet/nets/scorers/ctc.py
imports: import numpy
  import torch
  from espnet.nets.ctc_prefix_score import CTCPrefixScore, CTCPrefixScoreTH
  from espnet.nets.scorer_interface import BatchPartialScorerInterface
label_desc: Use image node_id 6 for calling the CTCPrefixScorer obj's underlying member method code with example usage: obj.batch_score_partial(y, ids, state, x) and returns: self