class_docstr: Scorer interface for beam search.
  
  The scorer performs scoring of the all tokens in vocabulary.
  
  Examples:
      * Search heuristics
          * :class:`espnet.nets.scorers.length_bonus.LengthBonus`
      * Decoder networks of the sequence-to-sequence models
          * :class:`espnet.nets.pytorch_backend.nets.transformer.decoder.Decoder`
          * :class:`espnet.nets.pytorch_backend.nets.rnn.decoders.Decoder`
      * Neural language models
          * :class:`espnet.nets.pytorch_backend.lm.transformer.TransformerLM`
          * :class:`espnet.nets.pytorch_backend.lm.default.DefaultRNNLM`
          * :class:`espnet.nets.pytorch_backend.lm.seq_rnn.SequentialRNNLM`
class_docstr_tok: ["Scorer","interface","for","beam","search",".","The","scorer","performs","scoring","of","the","all","tokens","in","vocabulary",".","Examples",":","*","Search","heuristics","*",":","class",":","`","espnet.nets.scorers.length_bonus.LengthBonus","`","*","Decoder","networks","of","the","sequence-to-sequence","models","*",":","class",":","`","espnet.nets.pytorch_backend.nets.transformer.decoder.Decoder","`","*",":","class",":","`","espnet.nets.pytorch_backend.nets.rnn.decoders.Decoder","`","*","Neural","language","models","*",":","class",":","`","espnet.nets.pytorch_backend.lm.transformer.TransformerLM","`","*",":","class",":","`","espnet.nets.pytorch_backend.lm.default.DefaultRNNLM","`","*",":","class",":","`","espnet.nets.pytorch_backend.lm.seq_rnn.SequentialRNNLM","`"]
docstr: Score new token (required).
  
  Args:
      y (torch.Tensor): 1D torch.int64 prefix tokens.
      state: Scorer state for prefix tokens
      x (torch.Tensor): The encoder feature that generates ys.
  
  Returns:
      tuple[torch.Tensor, Any]: Tuple of
          scores for next token that has a shape of `(n_vocab)`
          and next state for ys
docstr_tok: ["Score","new","token","(","required",")",".","Args",":","y","(","torch.Tensor",")",":","1D","torch.int64","prefix","tokens",".","state",":","Scorer","state","for","prefix","tokens","x","(","torch.Tensor",")",":","The","encoder","feature","that","generates","ys",".","Returns",":","tuple","[","torch.Tensor",",","Any","]",":","Tuple","of","scores","for","next","token","that","has","a","shape","of","`","(","n_vocab",")","`","and","next","state","for","ys"]
code: def score(
      self, y: torch.Tensor, state: Any, x: torch.Tensor
  ) -> Tuple[torch.Tensor, Any]:
      """Score new token (required).
  
      Args:
          y (torch.Tensor): 1D torch.int64 prefix tokens.
          state: Scorer state for prefix tokens
          x (torch.Tensor): The encoder feature that generates ys.
  
      Returns:
          tuple[torch.Tensor, Any]: Tuple of
              scores for next token that has a shape of `(n_vocab)`
              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 3 for calling the ScorerInterface obj's underlying member method code with example usage: obj.score(y, state, x) without return types