class_docstr: Batch partial scorer interface for beam search.
class_docstr_tok: ["Batch","partial","scorer","interface","for","beam","search","."]
docstr: Score new token (required).
  
  Args:
      ys (torch.Tensor): torch.int64 prefix tokens (n_batch, ylen).
      next_tokens (torch.Tensor): torch.int64 tokens to score (n_batch, n_token).
      states (List[Any]): Scorer states for prefix tokens.
      xs (torch.Tensor):
          The encoder feature that generates ys (n_batch, xlen, n_feat).
  
  Returns:
      tuple[torch.Tensor, Any]:
          Tuple of a score tensor for ys that has a shape `(n_batch, n_vocab)`
          and next states for ys
docstr_tok: ["Score","new","token","(","required",")",".","Args",":","ys","(","torch.Tensor",")",":","torch.int64","prefix","tokens","(","n_batch",",","ylen",")",".","next_tokens","(","torch.Tensor",")",":","torch.int64","tokens","to","score","(","n_batch",",","n_token",")",".","states","(","List","[","Any","]",")",":","Scorer","states","for","prefix","tokens",".","xs","(","torch.Tensor",")",":","The","encoder","feature","that","generates","ys","(","n_batch",",","xlen",",","n_feat",")",".","Returns",":","tuple","[","torch.Tensor",",","Any","]",":","Tuple","of","a","score","tensor","for","ys","that","has","a","shape","`","(","n_batch",",","n_vocab",")","`","and","next","states","for","ys"]
code: def batch_score_partial(
      self,
      ys: torch.Tensor,
      next_tokens: torch.Tensor,
      states: List[Any],
      xs: torch.Tensor,
  ) -> Tuple[torch.Tensor, Any]:
      """Score new token (required).
  
      Args:
          ys (torch.Tensor): torch.int64 prefix tokens (n_batch, ylen).
          next_tokens (torch.Tensor): torch.int64 tokens to score (n_batch, n_token).
          states (List[Any]): Scorer states for prefix tokens.
          xs (torch.Tensor):
              The encoder feature that generates ys (n_batch, xlen, n_feat).
  
      Returns:
          tuple[torch.Tensor, Any]:
              Tuple of a score tensor for ys that has a shape `(n_batch, n_vocab)`
              and next states 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 BatchPartialScorerInterface obj's underlying member method code with example usage: obj.batch_score_partial(ys, next_tokens, states, xs) without return types